Module: Errplane::Rails::Instrumentation

Defined in:
lib/errplane/rails/instrumentation.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



15
16
17
# File 'lib/errplane/rails/instrumentation.rb', line 15

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#benchmark_for_instrumentationObject



4
5
6
7
8
9
10
11
12
13
# File 'lib/errplane/rails/instrumentation.rb', line 4

def benchmark_for_instrumentation
  start = Time.now
  yield

  unless Errplane.configuration.ignore_current_environment?
    elapsed = ((Time.now - start) * 1000).ceil
    dimensions = { :method => "#{controller_name}##{action_name}", :server => Socket.gethostname }
    Errplane.aggregate "instrumentation", :value => elapsed, :dimensions => dimensions
  end
end