Sha256: 29382e92c3b2431b72490cf60a467cc7d427f1f921927237c81cc0786cd4ec5d
Contents?: true
Size: 614 Bytes
Versions: 20
Compression:
Stored size: 614 Bytes
Contents
module Rack::Insight class MemoryPanel < Panel def before(env) @original_memory = `ps -o rss= -p #{$$}`.to_i end def after(env, status, headers, body) total_memory = `ps -o rss= -p #{$$}`.to_i store(env, {:total_memory => total_memory, :memory_increase => total_memory - @original_memory, :original_memory => @original_memory}) end def heading_for_request(number) record = retrieve(number).first "#{record[:memory_increase]} KB Δ, #{record[:total_memory]} KB total" end def has_content? false end end end
Version data entries
20 entries across 20 versions & 1 rubygems