123456789_123456789_123456789_123456789_123456789_

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

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Mongo::Event::Base
Defined in: lib/mongo/monitoring/event/server_heartbeat_started.rb

Overview

::Mongo::Monitoring::Event fired when a server heartbeat is dispatched.

Since:

  • 2.7.0

Class Method Summary

Instance Attribute Summary

Instance Method Summary

::Mongo::Event::Base - Inherited

#summary

Returns a concise yet useful summary of the event.

#short_class_name

Constructor Details

.new(address, awaited: false) ⇒ ServerHeartbeatStarted

Create the event.

Examples:

Create the event.

ServerHeartbeatStarted.new(address)

Parameters:

  • address (Address)

    The server address.

  • awaited (true | false)

    Whether the heartbeat was awaited.

Since:

  • 2.7.0

[ GitHub ]

  
# File 'lib/mongo/monitoring/event/server_heartbeat_started.rb', line 42

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

Instance Attribute Details

#addressAddress (readonly)

Returns:

  • (Address)

    address The server address.

Since:

  • 2.7.0

[ GitHub ]

  
# File 'lib/mongo/monitoring/event/server_heartbeat_started.rb', line 25

attr_reader :address

#awaited?true | false (readonly)

Returns:

  • (true | false)

    Whether the heartbeat was awaited.

Since:

  • 2.7.0

[ GitHub ]

  
# File 'lib/mongo/monitoring/event/server_heartbeat_started.rb', line 28

def awaited?
  @awaited
end

Instance Method Details

#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

[ GitHub ]

  
# File 'lib/mongo/monitoring/event/server_heartbeat_started.rb', line 55

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