Sha256: 74c973a5c81dcf564236ce2f2f88af64ac7f2d30932407a51f4628db16273437
Contents?: true
Size: 459 Bytes
Versions: 18
Compression:
Stored size: 459 Bytes
Contents
class GooglePubsubEnhancer::Middleware::Logger::Duration def initialize(app,opts={},&substack) @app = app @logger = opts[:logger] @log_severity = opts[:log_severity] @substack = ::Middleware::Builder.new &substack end def call(env) measure_started = Time.now @substack.call(env) measure_stopped = Time.now @logger.send(@log_severity, "duration: #{measure_stopped - measure_started} sec") @app.call(env) end end
Version data entries
18 entries across 18 versions & 1 rubygems