rails-perftest 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -544,7 +544,7 @@ performance testing:
544
544
  Usage:
545
545
 
546
546
  ```bash
547
- Usage: rperf benchmarker 'Ruby.code' 'Ruby.more_code' ... [OPTS]
547
+ Usage: perftest benchmarker 'Ruby.code' 'Ruby.more_code' ... [OPTS]
548
548
  -r, --runs N Number of runs.
549
549
  Default: 4
550
550
  -o, --output PATH Directory to use when writing the results.
@@ -556,7 +556,7 @@ Usage: rperf benchmarker 'Ruby.code' 'Ruby.more_code' ... [OPTS]
556
556
  Example:
557
557
 
558
558
  ```bash
559
- $ rperf benchmarker 'Item.all' 'CouchItem.all' --runs 3 --metrics wall_time,memory
559
+ $ perftest benchmarker 'Item.all' 'CouchItem.all' --runs 3 --metrics wall_time,memory
560
560
  ```
561
561
 
562
562
  ### `profiler`
@@ -564,7 +564,7 @@ $ rperf benchmarker 'Item.all' 'CouchItem.all' --runs 3 --metrics wall_time,memo
564
564
  Usage:
565
565
 
566
566
  ```bash
567
- Usage: rperf profiler 'Ruby.code' 'Ruby.more_code' ... [OPTS]
567
+ Usage: perftest profiler 'Ruby.code' 'Ruby.more_code' ... [OPTS]
568
568
  -r, --runs N Number of runs.
569
569
  Default: 1
570
570
  -o, --output PATH Directory to use when writing the results.
@@ -578,7 +578,7 @@ Usage: rperf profiler 'Ruby.code' 'Ruby.more_code' ... [OPTS]
578
578
  Example:
579
579
 
580
580
  ```bash
581
- $ rperf profiler 'Item.all' 'CouchItem.all' --runs 2 --metrics process_time --formats flat
581
+ $ perftest profiler 'Item.all' 'CouchItem.all' --runs 2 --metrics process_time --formats flat
582
582
  ```
583
583
 
584
584
  NOTE: Metrics and formats vary from interpreter to interpreter. Pass `--help` to
@@ -17,7 +17,7 @@ module ActiveSupport
17
17
 
18
18
  # each implementation should define metrics and freeze the defaults
19
19
  DEFAULTS =
20
- if ARGV.include?('--benchmark') # HAX for rake test
20
+ if ENV["BENCHMARK_TESTS"]
21
21
  { :runs => 4,
22
22
  :output => 'tmp/performance',
23
23
  :benchmark => true }
@@ -6,7 +6,7 @@ module ActiveSupport
6
6
  module Testing
7
7
  module Performance
8
8
  DEFAULTS.merge!(
9
- if ARGV.include?('--benchmark')
9
+ if ENV["BENCHMARK_TESTS"]
10
10
  {:metrics => [:wall_time, :user_time, :memory, :gc_runs, :gc_time]}
11
11
  else
12
12
  { :metrics => [:wall_time],
@@ -4,7 +4,7 @@ module ActiveSupport
4
4
  module Testing
5
5
  module Performance
6
6
  DEFAULTS.merge!(
7
- if ARGV.include?('--benchmark')
7
+ if ENV["BENCHMARK_TESTS"]
8
8
  {:metrics => [:wall_time, :memory, :objects, :gc_runs, :gc_time]}
9
9
  else
10
10
  { :metrics => [:wall_time],
@@ -9,7 +9,7 @@ module ActiveSupport
9
9
  module Testing
10
10
  module Performance
11
11
  DEFAULTS.merge!(
12
- if ARGV.include?('--benchmark')
12
+ if ENV["BENCHMARK_TESTS"]
13
13
  { :metrics => [:wall_time, :memory, :objects, :gc_runs, :gc_time] }
14
14
  else
15
15
  { :min_percent => 0.01,
@@ -2,9 +2,9 @@ require 'optparse'
2
2
  require 'rails/test_help'
3
3
  require 'rails/performance_test_help'
4
4
 
5
- ARGV.push('--benchmark') # HAX
5
+ ENV["BENCHMARK_TESTS"] = '1'
6
+
6
7
  require 'rails/perftest/active_support/testing/performance'
7
- ARGV.pop
8
8
 
9
9
  def options
10
10
  options = {}
@@ -1,8 +1,11 @@
1
1
  namespace :test do
2
- Rails::SubTestTask.new(benchmark: 'test:prepare') do |t|
2
+ task 'perftest:benchmark_mode' do
3
+ ENV["BENCHMARK_TESTS"] = '1'
4
+ end
5
+
6
+ Rails::SubTestTask.new(benchmark: ['test:prepare', 'test:perftest:benchmark_mode']) do |t|
3
7
  t.libs << 'test'
4
8
  t.pattern = 'test/performance/**/*_test.rb'
5
- t.options = '-- --benchmark'
6
9
  end
7
10
 
8
11
  Rails::SubTestTask.new(profile: 'test:prepare') do |t|
@@ -1,5 +1,5 @@
1
1
  module Rails
2
2
  module Perftest
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = Rails::Perftest::VERSION
17
17
 
18
- gem.add_development_dependency 'ruby-prof'
18
+ gem.add_development_dependency 'ruby-prof', '>= 0.12.1'
19
19
  gem.add_development_dependency 'minitest', '>= 3'
20
20
  gem.add_development_dependency 'railties', '~> 4.0.0.beta'
21
21
  gem.add_development_dependency 'activerecord', '~> 4.0.0.beta'
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = Rails::Perftest::VERSION
17
17
 
18
- gem.add_development_dependency 'ruby-prof'
18
+ gem.add_development_dependency 'ruby-prof', '>= 0.12.1'
19
19
  gem.add_development_dependency 'minitest', '>= 3'
20
20
  gem.add_development_dependency 'railties', '~> 4.0.0.beta'
21
21
  gem.add_development_dependency 'activerecord', '~> 4.0.0.beta'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-perftest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,27 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-10 00:00:00.000000000 Z
12
+ date: 2013-03-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby-prof
16
- requirement: &70154369112060 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: '0'
21
+ version: 0.12.1
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70154369112060
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.12.1
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: minitest
27
- requirement: &70154369111060 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '3'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *70154369111060
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '3'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: railties
38
- requirement: &70154369110000 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ~>
@@ -43,10 +53,15 @@ dependencies:
43
53
  version: 4.0.0.beta
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *70154369110000
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 4.0.0.beta
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: activerecord
49
- requirement: &70154369109100 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ~>
@@ -54,10 +69,15 @@ dependencies:
54
69
  version: 4.0.0.beta
55
70
  type: :development
56
71
  prerelease: false
57
- version_requirements: *70154369109100
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 4.0.0.beta
58
78
  - !ruby/object:Gem::Dependency
59
79
  name: activemodel
60
- requirement: &70154369108460 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
61
81
  none: false
62
82
  requirements:
63
83
  - - ~>
@@ -65,10 +85,15 @@ dependencies:
65
85
  version: 4.0.0.beta
66
86
  type: :development
67
87
  prerelease: false
68
- version_requirements: *70154369108460
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 4.0.0.beta
69
94
  - !ruby/object:Gem::Dependency
70
95
  name: actionmailer
71
- requirement: &70154369107840 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
72
97
  none: false
73
98
  requirements:
74
99
  - - ~>
@@ -76,10 +101,15 @@ dependencies:
76
101
  version: 4.0.0.beta
77
102
  type: :development
78
103
  prerelease: false
79
- version_requirements: *70154369107840
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 4.0.0.beta
80
110
  - !ruby/object:Gem::Dependency
81
111
  name: actionpack
82
- requirement: &70154369107020 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
83
113
  none: false
84
114
  requirements:
85
115
  - - ~>
@@ -87,10 +117,15 @@ dependencies:
87
117
  version: 4.0.0.beta
88
118
  type: :development
89
119
  prerelease: false
90
- version_requirements: *70154369107020
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ~>
124
+ - !ruby/object:Gem::Version
125
+ version: 4.0.0.beta
91
126
  - !ruby/object:Gem::Dependency
92
127
  name: sqlite3
93
- requirement: &70154369106000 !ruby/object:Gem::Requirement
128
+ requirement: !ruby/object:Gem::Requirement
94
129
  none: false
95
130
  requirements:
96
131
  - - ~>
@@ -98,7 +133,12 @@ dependencies:
98
133
  version: '1.3'
99
134
  type: :development
100
135
  prerelease: false
101
- version_requirements: *70154369106000
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ~>
140
+ - !ruby/object:Gem::Version
141
+ version: '1.3'
102
142
  description: Rails performance tests (removed from core in Rails 4.0)
103
143
  email:
104
144
  - yves.senn@gmail.com
@@ -159,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
199
  version: '0'
160
200
  requirements: []
161
201
  rubyforge_project:
162
- rubygems_version: 1.8.10
202
+ rubygems_version: 1.8.23
163
203
  signing_key:
164
204
  specification_version: 3
165
205
  summary: ActionDispatch::PerformanceTest, ActiveSupport::Testing::Performance extracted