Sha256: 965eaa97db86e4d0a09bcbb9c80a3628d9e568762ce2285b34ecf5aff6b81e0e
Contents?: true
Size: 787 Bytes
Versions: 9
Compression:
Stored size: 787 Bytes
Contents
module Errplane module Rails module Instrumentation 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 def self.included(base) base.extend(ClassMethods) end module ClassMethods def instrument(methods = []) methods = [methods] unless methods.is_a?(Array) around_filter :benchmark_for_instrumentation, :only => methods end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems