ServerHeartbeatFailed — Documentation by YARD 0.9.37 (original) (raw)

Class: Mongo::Monitoring::Event::ServerHeartbeatFailed

Inherits:

Event::Base

Defined in:

lib/mongo/monitoring/event/server_heartbeat_failed.rb

Overview

Event fired when a server heartbeat is dispatched.

Instance Attribute Summary collapse

Instance Method Summarycollapse

Constructor Details

#initialize(address, round_trip_time, error, awaited: false, started_event:) ⇒ ServerHeartbeatFailed

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 48 # File 'lib/mongo/monitoring/event/server_heartbeat_failed.rb', line 40 def initialize(address, round_trip_time, error, awaited: false, started_event: ) @address = address @round_trip_time = round_trip_time @error = error @awaited = !!awaited @started_event = started_event end

Instance Attribute Details

#addressAddress

Returns address The server address.

51 52 53 # File 'lib/mongo/monitoring/event/server_heartbeat_failed.rb', line 51 def address @address end

#error ⇒ Exception Also known as:failure

Returns error The exception that occurred in hello call.

60 61 62 # File 'lib/mongo/monitoring/event/server_heartbeat_failed.rb', line 60 def error @error end

#round_trip_time ⇒ Float Also known as:duration

Returns round_trip_time Duration of hello call in seconds.

54 55 56 # File 'lib/mongo/monitoring/event/server_heartbeat_failed.rb', line 54 def round_trip_time @round_trip_time end

#started_eventMonitoring::Event::ServerHeartbeatStarted

Returns The corresponding started event.

74 75 76 # File 'lib/mongo/monitoring/event/server_heartbeat_failed.rb', line 74 def started_event @started_event end

Instance Method Details

#awaited? ⇒ true | false

Returns Whether the heartbeat was awaited.

66 67 68 # File 'lib/mongo/monitoring/event/server_heartbeat_failed.rb', line 66 def awaited? @awaited end

#summary ⇒ String

Note:

This method is experimental and subject to change.

Returns a concise yet useful summary of the event.

84 85 86 87 88 # File 'lib/mongo/monitoring/event/server_heartbeat_failed.rb', line 84 def summary "#<#{short_class_name}" + " address=#{address}" + " error=#{error.inspect}>" end