Class: Arkaan::Monitoring::Results::Heartbeat
- Inherits:
-
Object
- Object
- Arkaan::Monitoring::Results::Heartbeat
- Includes:
- Mongoid::Document
- Defined in:
- lib/arkaan/monitoring/results/heartbeat.rb
Overview
A record is the result of the vigilante asking the health of one instance.
Instance Attribute Summary collapse
-
#body ⇒ Hash
The JSON parsed body from the heartbeat request.
-
#ended_at ⇒ DateTime
The date at which the request was terminated.
-
#healthy ⇒ Boolean
TRUE if the instance is deemed healthy, FALSE otherwise.
-
#instance ⇒ Arkaan::Monitoring::Instance
The instance on which the record has been done.
-
#report ⇒ Arkaan::Monitoring::Results::Report
The report made by the vigilante including this record.
-
#started_at ⇒ DateTime
The date at which the heartbeat request has started.
-
#status ⇒ Integer
The HTTP status of the request made for this record.
Instance Method Summary collapse
Instance Attribute Details
#body ⇒ Hash
Returns the JSON parsed body from the heartbeat request.
14 |
# File 'lib/arkaan/monitoring/results/heartbeat.rb', line 14 field :body, type: Hash, default: {} |
#ended_at ⇒ DateTime
Returns the date at which the request was terminated.
23 |
# File 'lib/arkaan/monitoring/results/heartbeat.rb', line 23 field :ended_at, type: DateTime |
#healthy ⇒ Boolean
Returns TRUE if the instance is deemed healthy, FALSE otherwise.
17 |
# File 'lib/arkaan/monitoring/results/heartbeat.rb', line 17 field :healthy, type: Boolean, default: false |
#instance ⇒ Arkaan::Monitoring::Instance
Returns the instance on which the record has been done.
27 |
# File 'lib/arkaan/monitoring/results/heartbeat.rb', line 27 belongs_to :instance, class_name: 'Arkaan::Monitoring::Instance', inverse_of: :heartbeats |
#report ⇒ Arkaan::Monitoring::Results::Report
Returns the report made by the vigilante including this record.
31 |
# File 'lib/arkaan/monitoring/results/heartbeat.rb', line 31 belongs_to :report, class_name: 'Arkaan::Monitoring::Results::Report', inverse_of: :heartbeats |
#started_at ⇒ DateTime
Returns the date at which the heartbeat request has started.
20 |
# File 'lib/arkaan/monitoring/results/heartbeat.rb', line 20 field :started_at, type: DateTime |
#status ⇒ Integer
Returns the HTTP status of the request made for this record.
11 |
# File 'lib/arkaan/monitoring/results/heartbeat.rb', line 11 field :status, type: Integer, default: 500 |
Instance Method Details
#end! ⇒ Object
44 45 46 |
# File 'lib/arkaan/monitoring/results/heartbeat.rb', line 44 def end! self.ended_at = DateTime.now end |
#start! ⇒ Object
40 41 42 |
# File 'lib/arkaan/monitoring/results/heartbeat.rb', line 40 def start! self.started_at = DateTime.now end |