Class: Skylight::Core::Probes::Mongo::Subscriber Private

Inherits:
Object
  • Object
show all
Includes:
Util::Logging
Defined in:
lib/skylight/core/probes/mongo.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary collapse

COMMANDS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

%i[insert find count distinct update findandmodify delete aggregate].freeze
COMMAND_NAMES =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

{
  findandmodify: "findAndModify".freeze
}.freeze

Instance Method Summary collapse

Methods included from Util::Logging

#config_for_logging, #debug, #error, #fmt, #info, #log, #log_context, #log_env_prefix, #raise_on_error?, #t, #trace, #trace?, #warn

Constructor Details

#initializeSubscriber

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.

Returns a new instance of Subscriber.



21
22
23
# File 'lib/skylight/core/probes/mongo.rb', line 21

def initialize
  @events = {}
end

Instance Method Details

#configObject

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.

For logging



38
39
40
41
42
43
44
45
46
# File 'lib/skylight/core/probes/mongo.rb', line 38

def config
  # Just log to the first instrumentable's config for now.
  # FIXME: Revisit this
  if (instrumentable = Fanout.registered.first)
    if (instrumenter = instrumentable.instrumenter)
      instrumenter.config
    end
  end
end

#failed(event) ⇒ Object

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.



33
34
35
# File 'lib/skylight/core/probes/mongo.rb', line 33

def failed(event)
  end_instrumentation(event)
end

#started(event) ⇒ Object

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.



25
26
27
# File 'lib/skylight/core/probes/mongo.rb', line 25

def started(event)
  begin_instrumentation(event)
end

#succeeded(event) ⇒ Object

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.



29
30
31
# File 'lib/skylight/core/probes/mongo.rb', line 29

def succeeded(event)
  end_instrumentation(event)
end