padrino-performance 0.13.1.beta1 → 0.15.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
- SHA1:
3
- metadata.gz: bbc04dbf20ccfcdb47d832d1773010e8d38fc6a9
4
- data.tar.gz: e60a907e12e9d160c75f6f8c2865c7178a486457
2
+ SHA256:
3
+ metadata.gz: e7072582a57fcbe3564bd300071a7a4713cba89bff20803e5e34064644609ba5
4
+ data.tar.gz: 535a4b4259c0d790f00baff7d611a4872215a8ef7eeb175521f45cbf9b69af02
5
5
  SHA512:
6
- metadata.gz: 0db39cce255d1b305780fd573fb855c34b84dfde3b248e00f6f572a39b3c2ecbc1e9cb0f754957853763927fa6a956f2a5c408640f1570034465d99e159cdad5
7
- data.tar.gz: 9c5a6fef6508dc30afb5883c395175ac78d7ebddeb994e2838bd62454ec6a27d35b415e3240286a39a447623924d3134185b04b2f668ded906c72b1a95e12359
6
+ metadata.gz: e636bc51e25ded9d45b7d3d078e9bdac8728bae86281e8e0435722f055288a5bc49992210f781d859318f7c15c2fd8053dc5b3e30e9d45adaf298add2ade1ca9
7
+ data.tar.gz: 71d2b0a1ecdb0f4c536c7227fb2266ac127c88040e6b9e7b301bd25f18ed0fd55914e8d725c6a934e62858a850078ab4a1e89011863a3f9a7c3fb74abf5811cd
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.15.0' unless defined?(Padrino::VERSION)
5
5
 
6
6
  #
7
7
  # The current Padrino version.
@@ -5,7 +5,6 @@ require File.expand_path("../lib/padrino-performance/version.rb", __FILE__)
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "padrino-performance"
8
- s.rubyforge_project = "padrino-performance"
9
8
  s.authors = ["Padrino Team", "Nathan Esquenazi", "Davide D'Agostino", "Arthur Chiu", "Florian Gilcher", "Darío Javier Cravero", "Igor Bochkariov"]
10
9
  s.email = "padrinorb@gmail.com"
11
10
  s.summary = "A gem for finding performance problems in Padrino"
data/test/mem_core.rb ADDED
@@ -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.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Padrino Team
@@ -11,10 +11,10 @@ authors:
11
11
  - Florian Gilcher
12
12
  - Darío Javier Cravero
13
13
  - Igor Bochkariov
14
- autorequire:
14
+ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2015-10-18 00:00:00.000000000 Z
17
+ date: 2021-04-25 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,13 +36,14 @@ 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
42
43
  licenses:
43
44
  - MIT
44
45
  metadata: {}
45
- post_install_message:
46
+ post_install_message:
46
47
  rdoc_options:
47
48
  - "--charset=UTF-8"
48
49
  require_paths:
@@ -54,18 +55,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
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
- rubyforge_project: padrino-performance
62
- rubygems_version: 2.4.8
63
- signing_key:
62
+ rubygems_version: 3.0.8
63
+ signing_key:
64
64
  specification_version: 4
65
65
  summary: A gem for finding performance problems in Padrino
66
66
  test_files:
67
67
  - test/bench_core.rb
68
68
  - test/helper.rb
69
+ - test/mem_core.rb
69
70
  - test/test_os.rb
70
71
  - test/test_padrino_performance.rb
71
- has_rdoc: