Sha256: f0936fc0c56e2da905442cc30fd268bfa0debcc19291d04cd94b04f1122f5592

Contents?: true

Size: 1.01 KB

Versions: 40

Compression:

Stored size: 1.01 KB

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe Server, 'performance' do
  before do
    start_server do |env|
      body = env.inspect + env['rack.input'].read
      [200, { 'Content-Length' => body.size.to_s }, body]
    end
  end
  
  it "should handle GET in less then #{get_request_time = 0.0045} RubySecond" do
    proc { get('/') }.should be_faster_then(get_request_time)
  end
  
  it "should handle POST in less then #{post_request_time = 0.007} RubySecond" do
    proc { post('/', :file => 'X' * 1000) }.should be_faster_then(post_request_time)
  end
  
  after do
    stop_server
  end
end

describe Server, 'UNIX socket performance' do
  before do
    start_server('/tmp/thin_test.sock') do |env|
      body = env.inspect + env['rack.input'].read
      [200, { 'Content-Length' => body.size.to_s }, body]
    end
  end
  
  it "should handle GET in less then #{get_request_time = 0.002} RubySecond" do
    proc { get('/') }.should be_faster_then(get_request_time)
  end
  
  after do
    stop_server
  end
end

Version data entries

40 entries across 40 versions & 6 rubygems

Version Path
grockit-thin-0.8.2 spec/perf/server_perf_spec.rb
macournoyer-thin-1.0.1 spec/perf/server_perf_spec.rb
macournoyer-thin-1.1.0 spec/perf/server_perf_spec.rb
michaelyta-thin-1.2.2 spec/perf/server_perf_spec.rb
thin-1.2.11 spec/perf/server_perf_spec.rb
thin-1.2.11-x86-mswin32 spec/perf/server_perf_spec.rb
thin-1.2.11-x86-mingw32 spec/perf/server_perf_spec.rb
thin-1.2.10 spec/perf/server_perf_spec.rb
thin-1.2.10-x86-mswin32 spec/perf/server_perf_spec.rb
thin-1.2.10-x86-mingw32 spec/perf/server_perf_spec.rb
thin-1.2.9 spec/perf/server_perf_spec.rb
thin-1.2.9-x86-mswin32 spec/perf/server_perf_spec.rb
thin-1.2.9-x86-mingw32 spec/perf/server_perf_spec.rb
thin-1.2.8 spec/perf/server_perf_spec.rb
thin-1.2.8-x86-mswin32 spec/perf/server_perf_spec.rb
thin-1.2.8-x86-mingw32 spec/perf/server_perf_spec.rb
steamcannon-thin-1.2.8 spec/perf/server_perf_spec.rb
thin-1.2.7 spec/perf/server_perf_spec.rb
thin-1.2.7-x86-mswin32 spec/perf/server_perf_spec.rb
thin-1.2.7-x86-mingw32 spec/perf/server_perf_spec.rb