Class: Mongo::Monitoring::Event::ServerHeartbeatSucceeded
- Inherits:
-
Event::Base
- Object
- Event::Base
- Mongo::Monitoring::Event::ServerHeartbeatSucceeded
- Defined in:
- lib/mongo/monitoring/event/server_heartbeat_succeeded.rb
Overview
Event fired when a server heartbeat is dispatched.
Instance Attribute Summary collapse
-
#address ⇒ Address
readonly
Address The server address.
-
#round_trip_time ⇒ Float
(also: #duration)
readonly
Round_trip_time Duration of hello call in seconds.
-
#started_event ⇒ Monitoring::Event::ServerHeartbeatStarted
readonly
The corresponding started event.
Instance Method Summary collapse
-
#awaited? ⇒ true | false
Whether the heartbeat was awaited.
-
#initialize(address, round_trip_time, awaited: false, started_event:) ⇒ ServerHeartbeatSucceeded
constructor
private
Create the event.
-
#summary ⇒ String
Returns a concise yet useful summary of the event.
Constructor Details
#initialize(address, round_trip_time, awaited: false, started_event:) ⇒ ServerHeartbeatSucceeded
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Create the event.
40 41 42 43 44 45 46 47 |
# File 'lib/mongo/monitoring/event/server_heartbeat_succeeded.rb', line 40 def initialize(address, round_trip_time, awaited: false, started_event: ) @address = address @round_trip_time = round_trip_time @awaited = !!awaited @started_event = started_event end |
Instance Attribute Details
#address ⇒ Address (readonly)
Returns address The server address.
50 51 52 |
# File 'lib/mongo/monitoring/event/server_heartbeat_succeeded.rb', line 50 def address @address end |
#round_trip_time ⇒ Float (readonly) Also known as: duration
Returns round_trip_time Duration of hello call in seconds.
53 54 55 |
# File 'lib/mongo/monitoring/event/server_heartbeat_succeeded.rb', line 53 def round_trip_time @round_trip_time end |
#started_event ⇒ Monitoring::Event::ServerHeartbeatStarted (readonly)
Returns The corresponding started event.
67 68 69 |
# File 'lib/mongo/monitoring/event/server_heartbeat_succeeded.rb', line 67 def started_event @started_event end |
Instance Method Details
#awaited? ⇒ true | false
Returns Whether the heartbeat was awaited.
59 60 61 |
# File 'lib/mongo/monitoring/event/server_heartbeat_succeeded.rb', line 59 def awaited? @awaited end |
#summary ⇒ String
Note:
This method is experimental and subject to change.
Returns a concise yet useful summary of the event.
77 78 79 80 |
# File 'lib/mongo/monitoring/event/server_heartbeat_succeeded.rb', line 77 def summary "#<#{short_class_name}" + " address=#{address}>" end |