Module: Strumbar

Defined in:
lib/strumbar.rb,
lib/strumbar/client.rb,
lib/strumbar/version.rb,
lib/strumbar/configuration.rb,
lib/strumbar/instrumentation.rb,
lib/strumbar/instrumentation/redis.rb,
lib/strumbar/instrumentation/mongoid.rb,
lib/strumbar/instrumentation/active_record.rb,
lib/strumbar/instrumentation/action_controller.rb,
lib/strumbar/instrumentation/mongoid/runtime_tracker.rb,
lib/strumbar/instrumentation/mongoid/controller_runtime.rb

Defined Under Namespace

Modules: Instrumentation Classes: Client, Configuration, InstrumentList

Constant Summary collapse

VERSION =
"0.4.0"

Class Method Summary collapse

Class Method Details

.clientObject



18
19
20
# File 'lib/strumbar.rb', line 18

def client
  @client ||= Client.new host, port
end

.configurationObject



22
23
24
# File 'lib/strumbar.rb', line 22

def configuration
  @configuration ||= Configuration.new
end

.configure {|@configuration| ... } ⇒ Object

Yields:



12
13
14
15
16
# File 'lib/strumbar.rb', line 12

def configure
  @configuration = Configuration.new
  yield @configuration
  Instrumentation.load
end

.strum(event, payload, &block) ⇒ Object



35
36
37
# File 'lib/strumbar.rb', line 35

def strum event, payload, &block
  ActiveSupport::Notifications.instrument event, payload, &block
end

.subscribe(identifier) ⇒ Object



28
29
30
31
32
33
# File 'lib/strumbar.rb', line 28

def subscribe identifier
  ActiveSupport::Notifications.subscribe identifier do |*args|
    event = ActiveSupport::Notifications::Event.new(*args)
    yield client, event
  end
end