Sha256: d893dcc8e214688190d043e230fa6940ba8ffc41d67d718c5e046cf719c5a6ba
Contents?: true
Size: 594 Bytes
Versions: 9
Compression:
Stored size: 594 Bytes
Contents
module RubyApp module Rack require 'ruby_app' class Memory def initialize(application, options = {}) @application = application @options = {:interval => 5}.merge(options) @count = 0 end def call(environment) if @count.modulo(@options[:interval]) == 0 @count = 1 RubyApp::Log.memory(RubyApp::Log::DEBUG, 'MEMORY ') do return @application.call(environment) end else @count += 1 return @application.call(environment) end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems