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 +4 -4
- data/Rakefile +5 -0
- data/lib/padrino-performance/version.rb +1 -1
- data/test/mem_core.rb +66 -0
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eeaf7980c8a4687b7810a871d963282633f3559e
|
4
|
+
data.tar.gz: 750c53bd4c68474388ef2c847ccd267f9f1d9e32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b6e45f984273bba4d6c3652a902d074447cc6bf6485be8dc3d76963741608362afb9d3f6ab78dddda66be4c8b09a649e38899b2986030b6fbf59b007779de23
|
7
|
+
data.tar.gz: bd0886c470cc3f12aa3544d2c353adc0758ff575df7791125a44ad06fc85188d11a08df2e3d9aa1a3010c636e29f15cdd24c00bd8f7797f46e7423942a82be68
|
data/Rakefile
CHANGED
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
|
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:
|
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
|
-
-
|
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.
|
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:
|