Class: Mongo::Monitoring::Event::ServerHeartbeatStarted

Inherits:
Event::Base
  • Object
show all
Defined in:
build/ruby-driver-v2.19/lib/mongo/monitoring/event/server_heartbeat_started.rb

Overview

Event fired when a server heartbeat is dispatched.

Since:

  • 2.7.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(address, awaited: false) ⇒ ServerHeartbeatStarted

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.

ServerHeartbeatStarted.new(address)

Parameters:

  • address (Address)

    The server address.

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

    Whether the heartbeat was awaited.

Since:

  • 2.7.0



45
46
47
48
# File 'build/ruby-driver-v2.19/lib/mongo/monitoring/event/server_heartbeat_started.rb', line 45

def initialize(address, awaited: false)
  @address = address
  @awaited = !!awaited
end

Instance Attribute Details

#addressAddress (readonly)

Returns address The server address.

Returns:

  • (Address)

    address The server address.

Since:

  • 2.7.0



28
29
30
# File 'build/ruby-driver-v2.19/lib/mongo/monitoring/event/server_heartbeat_started.rb', line 28

def address
  @address
end

Instance Method Details

#awaited?true | false

Returns Whether the heartbeat was awaited.

Returns:

  • (true | false)

    Whether the heartbeat was awaited.

Since:

  • 2.7.0



31
32
33
# File 'build/ruby-driver-v2.19/lib/mongo/monitoring/event/server_heartbeat_started.rb', line 31

def awaited?
  @awaited
end

#summaryString

Note:

This method is experimental and subject to change.

Returns a concise yet useful summary of the event.

Returns:

  • (String)

    String summary of the event.

Since:

  • 2.7.0



58
59
60
61
# File 'build/ruby-driver-v2.19/lib/mongo/monitoring/event/server_heartbeat_started.rb', line 58

def summary
  "#<#{short_class_name}" +
  " address=#{address}>"
end