Sha256: 8b8a8c8b1ad655e8c43e88737b3dd0114417d2cadce23487936c7b409bcf4b43
Contents?: true
Size: 699 Bytes
Versions: 5
Compression:
Stored size: 699 Bytes
Contents
module Errplane module Rails module Instrumentation def benchmark_for_instrumentation start = Time.now yield elapsed = ((Time.now - start) * 1000).ceil dimensions = { :method => "#{controller_name}##{action_name}", :server => Socket.gethostname } Errplane.rollup "instrumentation", :value => elapsed, :dimensions => dimensions 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
5 entries across 5 versions & 1 rubygems