Class: AceMQ::AMQP::Health::Report
- Inherits:
-
Struct
- Object
- Struct
- AceMQ::AMQP::Health::Report
- Defined in:
- lib/acemq/amqp/health.rb
Overview
What a check found.
parts is whatever the check can say about itself — how many consumers
there are, how long the broker took to answer, what a nested check
reported — and it is the half somebody reads when the status alone does
not tell them what to do.
Instance Attribute Summary collapse
-
#checked_at ⇒ Object
Returns the value of attribute checked_at.
-
#detail ⇒ Object
Returns the value of attribute detail.
-
#parts ⇒ Object
Returns the value of attribute parts.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
- #degraded? ⇒ Boolean
- #down? ⇒ Boolean
-
#to_h ⇒ Object
The shape every AceMQ library renders at
/acemq-health. - #to_s ⇒ Object
- #up? ⇒ Boolean
Instance Attribute Details
#checked_at ⇒ Object
Returns the value of attribute checked_at
64 65 66 |
# File 'lib/acemq/amqp/health.rb', line 64 def checked_at @checked_at end |
#detail ⇒ Object
Returns the value of attribute detail
64 65 66 |
# File 'lib/acemq/amqp/health.rb', line 64 def detail @detail end |
#parts ⇒ Object
Returns the value of attribute parts
64 65 66 |
# File 'lib/acemq/amqp/health.rb', line 64 def parts @parts end |
#status ⇒ Object
Returns the value of attribute status
64 65 66 |
# File 'lib/acemq/amqp/health.rb', line 64 def status @status end |
Instance Method Details
#degraded? ⇒ Boolean
67 |
# File 'lib/acemq/amqp/health.rb', line 67 def degraded? = status == DEGRADED |
#to_h ⇒ Object
The shape every AceMQ library renders at /acemq-health.
70 71 72 73 74 75 |
# File 'lib/acemq/amqp/health.rb', line 70 def to_h rendered = { "status" => status.to_s, "checked" => checked_at.utc.iso8601 } rendered["detail"] = detail unless detail.nil? || detail.empty? rendered["parts"] = parts.transform_values { |v| v.is_a?(Report) ? v.to_h : v } rendered end |
#to_s ⇒ Object
77 |
# File 'lib/acemq/amqp/health.rb', line 77 def to_s = detail.to_s.empty? ? status.to_s : "#{status}: #{detail}" |