lib/mongo/monitoring/publishable.rb in mongo-2.8.0 vs lib/mongo/monitoring/publishable.rb in mongo-2.9.0.rc0
- old
+ new
@@ -22,10 +22,11 @@
include Loggable
# @return [ Monitoring ] monitoring The monitoring.
attr_reader :monitoring
+ # @deprecated
def publish_event(topic, event)
monitoring.succeeded(topic, event)
end
def publish_sdam_event(topic, event)
@@ -33,15 +34,22 @@
log_debug("EVENT: #{event.summary}")
monitoring.succeeded(topic, event)
end
+ def publish_cmap_event(event)
+ return unless monitoring?
+
+ monitoring.published(Monitoring::CONNECTION_POOL, event)
+ end
+
private
- def command_started(address, operation_id, payload)
+ def command_started(address, operation_id, payload, socket_object_id = nil)
monitoring.started(
Monitoring::COMMAND,
- Event::CommandStarted.generate(address, operation_id, payload)
+ Event::CommandStarted.generate(address, operation_id, payload,
+ socket_object_id)
)
end
def command_completed(result, address, operation_id, payload, duration)
document = result ? (result.documents || []).first : nil