Sha256: f324ce881cd205b100e6825fcd3c77c1972937a67473445757abfbad8161c0da

Contents?: true

Size: 459 Bytes

Versions: 23

Compression:

Stored size: 459 Bytes

Contents

# lib-large-file-response will stop running if we're not on Linux here
use Rack::ContentLength
use Rack::ContentType
map "/rss" do
  run lambda { |env|
    # on Linux, this is in kilobytes
    GC.start if GC.respond_to?(:start)
    ::File.read("/proc/self/status") =~ /^VmRSS:\s+(\d+)/
    [ 200, {}, [ ($1.to_i * 1024).to_s ] ]
  }
end
map "/pid" do
  run lambda { |env| [ 200, {}, [ "#{Process.pid}\n" ] ] }
end
map "/" do
  run Rack::File.new(Dir.pwd)
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
rainbows-5.2.1 t/large-file-response.ru
rainbows-5.2.0 t/large-file-response.ru
rainbows-5.1.1 t/large-file-response.ru
rainbows-5.1.0 t/large-file-response.ru
rainbows-5.0.0.5.ge717 t/large-file-response.ru
rainbows-5.0.0 t/large-file-response.ru
rainbows-4.7.0 t/large-file-response.ru
rainbows-4.6.2 t/large-file-response.ru
rainbows-4.6.1 t/large-file-response.ru
rainbows-4.6.0.4.g4108 t/large-file-response.ru
rainbows-4.6.0 t/large-file-response.ru
rainbows-4.5.0 t/large-file-response.ru
rainbows-4.4.3 t/large-file-response.ru
rainbows-4.4.2 t/large-file-response.ru
rainbows-4.4.1.1.gd5c8c t/large-file-response.ru
rainbows-4.4.1 t/large-file-response.ru
rainbows-4.4.0 t/large-file-response.ru
rainbows-4.3.1 t/large-file-response.ru
rainbows-4.3.0 t/large-file-response.ru
rainbows-4.2.0 t/large-file-response.ru