padrino-performance 0.13.1.beta1 → 0.13.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bbc04dbf20ccfcdb47d832d1773010e8d38fc6a9
4
- data.tar.gz: e60a907e12e9d160c75f6f8c2865c7178a486457
3
+ metadata.gz: eeaf7980c8a4687b7810a871d963282633f3559e
4
+ data.tar.gz: 750c53bd4c68474388ef2c847ccd267f9f1d9e32
5
5
  SHA512:
6
- metadata.gz: 0db39cce255d1b305780fd573fb855c34b84dfde3b248e00f6f572a39b3c2ecbc1e9cb0f754957853763927fa6a956f2a5c408640f1570034465d99e159cdad5
7
- data.tar.gz: 9c5a6fef6508dc30afb5883c395175ac78d7ebddeb994e2838bd62454ec6a27d35b415e3240286a39a447623924d3134185b04b2f668ded906c72b1a95e12359
6
+ metadata.gz: 3b6e45f984273bba4d6c3652a902d074447cc6bf6485be8dc3d76963741608362afb9d3f6ab78dddda66be4c8b09a649e38899b2986030b6fbf59b007779de23
7
+ data.tar.gz: bd0886c470cc3f12aa3544d2c353adc0758ff575df7791125a44ad06fc85188d11a08df2e3d9aa1a3010c636e29f15cdd24c00bd8f7797f46e7423942a82be68
data/Rakefile CHANGED
@@ -4,3 +4,8 @@ Rake::TestTask.new(:bench) do |test|
4
4
  test.libs << 'test'
5
5
  test.test_files = Dir['test/**/bench_*.rb']
6
6
  end
7
+
8
+ Rake::TestTask.new(:mem) do |test|
9
+ test.libs << 'test'
10
+ test.test_files = Dir['test/**/mem_*.rb']
11
+ end
@@ -1,7 +1,7 @@
1
1
  module Padrino
2
2
  module Performance
3
3
  # The version constant for the current version of Padrino.
4
- VERSION = '0.13.1.beta1' unless defined?(Padrino::VERSION)
4
+ VERSION = '0.13.1' unless defined?(Padrino::VERSION)
5
5
 
6
6
  #
7
7
  # The current Padrino version.
@@ -0,0 +1,66 @@
1
+ ENV['RACK_ENV'] = 'test'
2
+
3
+ require 'padrino-core'
4
+
5
+ require 'minitest/autorun'
6
+ require 'minitest/benchmark'
7
+ require 'rack/test'
8
+
9
+ module MockBenchmark
10
+ include Rack::Test::Methods
11
+
12
+ module Settings
13
+ def bench_range
14
+ [20, 80, 320, 1280, 5120]
15
+ end
16
+
17
+ def run(*)
18
+ puts 'Running ' + self.name
19
+ puts `pmap -x #{$$} | tail -1`
20
+ super
21
+ puts `pmap -x #{$$} | tail -1`
22
+ end
23
+ end
24
+
25
+ def self.included(base)
26
+ base.extend Settings
27
+ end
28
+
29
+ def result_code
30
+ ''
31
+ end
32
+
33
+ def app
34
+ @app
35
+ end
36
+ end
37
+
38
+ class Padrino::HugeRouterBenchmark < Minitest::Benchmark
39
+ include MockBenchmark
40
+
41
+ def setup
42
+ @apps = {}
43
+ @pathss = {}
44
+ @requests = {}
45
+ self.class.bench_range.each do |n|
46
+ @pathss[n] = paths = (1..n/5).map{ rand(36**8).to_s(36) }
47
+ @apps[n] = Sinatra.new Padrino::Application do
48
+ paths.each do |p|
49
+ get("/#{p}") { p.to_s }
50
+ end
51
+ end
52
+ @requests[n] = Rack::MockRequest.new(@apps[n])
53
+ @requests[n].get('/')
54
+ end
55
+ end
56
+
57
+ def bench_calling_sample
58
+ response = nil
59
+ assert_performance_linear 0.99 do |n|
60
+ n.times do
61
+ response = @requests[n].get("/#{@pathss[n].sample}")
62
+ end
63
+ end
64
+ assert_equal 200, response.status
65
+ end
66
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: padrino-performance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.1.beta1
4
+ version: 0.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Padrino Team
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2015-10-18 00:00:00.000000000 Z
17
+ date: 2016-01-17 00:00:00.000000000 Z
18
18
  dependencies: []
19
19
  description: A gem for finding performance problems in Padrino by tracking loads and
20
20
  memory consumption.
@@ -36,6 +36,7 @@ files:
36
36
  - padrino-performance.gemspec
37
37
  - test/bench_core.rb
38
38
  - test/helper.rb
39
+ - test/mem_core.rb
39
40
  - test/test_os.rb
40
41
  - test/test_padrino_performance.rb
41
42
  homepage: http://www.padrinorb.com
@@ -44,19 +45,19 @@ licenses:
44
45
  metadata: {}
45
46
  post_install_message:
46
47
  rdoc_options:
47
- - "--charset=UTF-8"
48
+ - --charset=UTF-8
48
49
  require_paths:
49
50
  - lib
50
51
  required_ruby_version: !ruby/object:Gem::Requirement
51
52
  requirements:
52
- - - ">="
53
+ - - '>='
53
54
  - !ruby/object:Gem::Version
54
55
  version: '0'
55
56
  required_rubygems_version: !ruby/object:Gem::Requirement
56
57
  requirements:
57
- - - ">"
58
+ - - '>='
58
59
  - !ruby/object:Gem::Version
59
- version: 1.3.1
60
+ version: 1.3.6
60
61
  requirements: []
61
62
  rubyforge_project: padrino-performance
62
63
  rubygems_version: 2.4.8
@@ -66,6 +67,7 @@ summary: A gem for finding performance problems in Padrino
66
67
  test_files:
67
68
  - test/bench_core.rb
68
69
  - test/helper.rb
70
+ - test/mem_core.rb
69
71
  - test/test_os.rb
70
72
  - test/test_padrino_performance.rb
71
73
  has_rdoc: