Method: Mongo::Monitoring::Event::ServerHeartbeatSucceeded#initialize

Defined in:
lib/mongo/monitoring/event/server_heartbeat_succeeded.rb

#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.

Examples:

Create the event.

ServerHeartbeatSucceeded.new(address, duration)

Parameters:

  • address (Address)

    The server address.

  • round_trip_time (Float)

    Duration of hello call in seconds.

  • awaited (true | false) (defaults to: false)

    Whether the heartbeat was awaited.

  • started_event (Monitoring::Event::ServerHeartbeatStarted)

    The corresponding started event.

Since:

  • 2.7.0



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