Sha256: 7dfd6c2f7c3a7dd8ec552dd310997bd1326d6f5e13821b2343e93a147f03b54c

Contents?: true

Size: 593 Bytes

Versions: 6

Compression:

Stored size: 593 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

6 entries across 6 versions & 1 rubygems

Version Path
RubyApp-0.7.16 lib/ruby_app/rack/memory.rb
RubyApp-0.7.15 lib/ruby_app/rack/memory.rb
RubyApp-0.7.14 lib/ruby_app/rack/memory.rb
RubyApp-0.7.13 lib/ruby_app/rack/memory.rb
RubyApp-0.7.12 lib/ruby_app/rack/memory.rb
RubyApp-0.6.71 lib/ruby_app/rack/memory.rb