Class: HermesAgent::Client::Entities::HealthDetails

Inherits:
HermesAgent::Client::Entity show all
Defined in:
lib/hermes_agent/client/entities/health.rb

Overview

The result of a detailed server health check (/health/detailed). Field readers are best-effort; HermesAgent::Client::Entity#to_h remains the source of truth.

Instance Method Summary collapse

Methods inherited from HermesAgent::Client::Entity

#==, #[], #eql?, #hash, #to_h

Instance Method Details

#active_agentsInteger?

The number of agents currently running on the server.

Returns:

  • (Integer, nil)


110
111
112
# File 'lib/hermes_agent/client/entities/health.rb', line 110

def active_agents
  self["active_agents"]
end

#exit_reasonString?

The reason the gateway exited, or nil while it is running.

Returns:

  • (String, nil)


118
119
120
# File 'lib/hermes_agent/client/entities/health.rb', line 118

def exit_reason
  self["exit_reason"]
end

#gateway_stateString?

The gateway's lifecycle state, e.g. "running".

Returns:

  • (String, nil)


89
90
91
# File 'lib/hermes_agent/client/entities/health.rb', line 89

def gateway_state
  self["gateway_state"]
end

#pidInteger?

The process id of the running gateway.

Returns:

  • (Integer, nil)


134
135
136
# File 'lib/hermes_agent/client/entities/health.rb', line 134

def pid
  self["pid"]
end

#platformString?

The platform identifier, e.g. "hermes-agent".

Returns:

  • (String, nil)


81
82
83
# File 'lib/hermes_agent/client/entities/health.rb', line 81

def platform
  self["platform"]
end

#platformsHash{String => PlatformStatus}?

The per-platform connection state, keyed by platform name (e.g. "api_server"), each value wrapped in a PlatformStatus. Returns nil when the field is absent.

Returns:



99
100
101
102
103
104
# File 'lib/hermes_agent/client/entities/health.rb', line 99

def platforms
  raw = self["platforms"]
  return nil unless raw.is_a?(::Hash)

  raw.transform_values { |value| PlatformStatus.new(value) }
end

#statusString?

The reported health status, e.g. "ok".

Returns:

  • (String, nil)


73
74
75
# File 'lib/hermes_agent/client/entities/health.rb', line 73

def status
  self["status"]
end

#updated_atString?

When this health snapshot was produced (ISO-8601 timestamp string).

Returns:

  • (String, nil)


126
127
128
# File 'lib/hermes_agent/client/entities/health.rb', line 126

def updated_at
  self["updated_at"]
end