File: instrumentation.rb

package info (click to toggle)
ruby-raemon 0.3.0%2Bgit.2012.05.18.b78eaae57c-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 220 kB
  • ctags: 104
  • sloc: ruby: 901; makefile: 4
file content (11 lines) | stat: -rw-r--r-- 368 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
module Raemon
  # Provides a safe interface to instrument Raemon
  module Instrumentation
    def instrument(name, payload={}, &block)
      if Raemon.config.instrumentor.respond_to? :instrument
        full_name = "#{Raemon.config.instrumentor_name}.#{name}"
        Raemon.config.instrumentor.send :instrument, full_name, payload, &block
      end
    end
  end
end