Sha256: 1d8bcf9d9e077c0658e6ad939e88e852eb72fdc4d6aba8186a2fe5a97daa46cb

Contents?: true

Size: 1005 Bytes

Versions: 48

Compression:

Stored size: 1005 Bytes

Contents

require '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

48 entries across 48 versions & 2 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/thin-1.3.1/spec/perf/server_perf_spec.rb
classiccms-0.7.4 vendor/bundle/gems/thin-1.3.1/spec/perf/server_perf_spec.rb
classiccms-0.7.3 vendor/bundle/gems/thin-1.3.1/spec/perf/server_perf_spec.rb
classiccms-0.7.2 vendor/bundle/gems/thin-1.3.1/spec/perf/server_perf_spec.rb
classiccms-0.7.1 vendor/bundle/gems/thin-1.3.1/spec/perf/server_perf_spec.rb
classiccms-0.7.0 vendor/bundle/gems/thin-1.3.1/spec/perf/server_perf_spec.rb
classiccms-0.6.9 vendor/bundle/gems/thin-1.3.1/spec/perf/server_perf_spec.rb
classiccms-0.6.8 vendor/bundle/gems/thin-1.3.1/spec/perf/server_perf_spec.rb
classiccms-0.6.7 vendor/bundle/gems/thin-1.3.1/spec/perf/server_perf_spec.rb
classiccms-0.6.6 vendor/bundle/gems/thin-1.3.1/spec/perf/server_perf_spec.rb
classiccms-0.6.5 vendor/bundle/gems/thin-1.3.1/spec/perf/server_perf_spec.rb
classiccms-0.6.4 vendor/bundle/gems/thin-1.3.1/spec/perf/server_perf_spec.rb
classiccms-0.6.3 vendor/bundle/gems/thin-1.3.1/spec/perf/server_perf_spec.rb
classiccms-0.6.2 vendor/bundle/gems/thin-1.3.1/spec/perf/server_perf_spec.rb
classiccms-0.6.1 vendor/bundle/gems/thin-1.3.1/spec/perf/server_perf_spec.rb
classiccms-0.6.0 vendor/bundle/gems/thin-1.3.1/spec/perf/server_perf_spec.rb
classiccms-0.5.17 vendor/bundle/gems/thin-1.3.1/spec/perf/server_perf_spec.rb
classiccms-0.5.16 vendor/bundle/gems/thin-1.3.1/spec/perf/server_perf_spec.rb
classiccms-0.5.15 vendor/bundle/gems/thin-1.3.1/spec/perf/server_perf_spec.rb
classiccms-0.5.14 vendor/bundle/gems/thin-1.3.1/spec/perf/server_perf_spec.rb