perf_check 0.10.4 → 0.10.5

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
  SHA256:
3
- metadata.gz: 2e073e79c2756b326a86eb0770eb86820d121c75f590b58948fe30481a5bedec
4
- data.tar.gz: 9da6ab0dcf5dd4e222d112ff3490cbdf7eec84e885d7203a0aab403e5a5160f4
3
+ metadata.gz: 8e7e73abde3ebfe2f92f12eed41e71cc0a1aebb0757bca2b633f0dfee228e3a9
4
+ data.tar.gz: 72f12606679f3f271637236bf5790d237cd4884c2802fc64eb2c7aacf285068d
5
5
  SHA512:
6
- metadata.gz: 95ef058469bd7891b3d6dbf7adfa4abc639f641187ad0304b601f8d2d8012ffd8f1d527accb865d3673fe41e8123fb049737334bbe0693d53e7df0d13cae44cd
7
- data.tar.gz: bd350af6ac0645043b5169950fd7d24812ddb66cd536f8126f733300ec7e891971364da9eb2b5c2763945e4e8907888b1173205f10269ff82f448ab79c14bc2b
6
+ metadata.gz: 1f3ce1ff0e21efa6bca872cd7d51da8fcd2444b05e900556cb86be07a693c6721c86f68f97535f22bf2f3d7faf0a76d676ab50cb0ab6f1875c25e0242cb2fe7e
7
+ data.tar.gz: 36c0cb1e974bce896cda36d2a0f88dd549ed9a0e7e10b657ec9731244b5c9e77e00ecfc2363f06098182967da2c0f2db87ba208e33774ce3b4c52500d4f549f2
@@ -29,7 +29,8 @@ class PerfCheck
29
29
  brief: false,
30
30
  caching: true,
31
31
  json: false,
32
- hard_reset: false
32
+ hard_reset: false,
33
+ environment: 'development'
33
34
  )
34
35
 
35
36
  @logger = Logger.new(STDERR).tap do |logger|
@@ -15,52 +15,65 @@ class PerfCheck
15
15
 
16
16
  opts.separator "\nBenchmark options:"
17
17
  opts.on('--requests N', '-n',
18
- 'Use N requests in benchmark, defaults to 20') do |n|
18
+ 'Use N requests in benchmark, defaults to 20') do |n|
19
19
  options.number_of_requests = n.to_i
20
20
  end
21
21
 
22
22
  opts.on('--reference COMMIT', '-r',
23
- 'Benchmark against COMMIT instead of master') do |commit|
23
+ 'Benchmark against COMMIT instead of master') do |commit|
24
24
  options.reference = commit
25
25
  end
26
26
 
27
27
  opts.on('--branch COMMIT', '-branch',
28
- 'Set the current branch to benchmark against (defaults to the branch you currently have checked out)') do |branch|
28
+ 'Set the current branch to benchmark against (defaults to the branch you currently have checked out)') do |branch|
29
29
  options.branch = branch
30
30
  end
31
31
 
32
32
  opts.on('--quick', '-q',
33
- '20 requests just on this branch (no comparison with master)') do
33
+ '20 requests just on this branch (no comparison with master)') do
34
34
  options.reference = nil
35
35
  end
36
36
 
37
- opts.on('--no-caching', 'Do not enable fragment caching (Rails.cache will still work)') do
38
- options.caching = false
37
+ opts.on('--compare-paths',
38
+ 'Compare two paths against each other on the same branch') do
39
+ options[:compare_paths?] = true
39
40
  end
40
41
 
41
- opts.on('--run-migrations', 'Run migrations on the branch and unmigrate at the end') do
42
- options[:run_migrations?] = true
42
+ opts.on('--302-success',
43
+ 'Consider HTTP 302 code a successful request') do
44
+ options.http_statuses.push(302)
43
45
  end
44
46
 
45
- opts.on('--compare-paths', 'Compare two paths against each other on the same branch') do
46
- options[:compare_paths?] = true
47
+ opts.on('--302-failure',
48
+ 'Consider HTTP 302 code an unsuccessful request') do
49
+ options.http_statuses.delete(302)
47
50
  end
48
51
 
49
- opts.on('--302-success', 'Consider HTTP 302 code a successful request') do
50
- options.http_statuses.push(302)
52
+ opts.separator "\nRails environment"
53
+
54
+ opts.on('--deployment','Use git fetch/reset instead of the safe/friendly checkout') do
55
+ options.hard_reset = true
51
56
  end
52
57
 
53
- opts.on('--302-failure', 'Consider HTTP 302 code an unsuccessful request') do
54
- options.http_statuses.delete(302)
58
+ opts.on('--environment', '-e',
59
+ 'Change the rails environment we are profiling. Defaults to development') do |env|
60
+ options.environment = env
61
+ end
62
+
63
+ opts.on('--no-caching',
64
+ 'Do not enable fragment caching (Rails.cache will still work)') do
65
+ options.caching = false
55
66
  end
56
67
 
57
68
  opts.separator "\nMisc"
69
+
58
70
  opts.on('-h', 'Display this help') do
59
71
  # Do nothing, just don't error
60
72
  end
61
73
 
62
- opts.on('--deployment','Use git fetch/reset instead of the safe/friendly checkout') do
63
- options.hard_reset = true
74
+ opts.on('--run-migrations',
75
+ 'Run migrations on the branch and unmigrate at the end') do
76
+ options[:run_migrations?] = true
64
77
  end
65
78
 
66
79
  opts.on('--cookie COOKIE', '-c') do |cookie|
@@ -114,7 +114,7 @@ class PerfCheck
114
114
  Dir.chdir app_root do
115
115
  pid = Process.spawn(
116
116
  perf_check_args,
117
- "bundle exec rails server -b #{host} -d -p #{port}",
117
+ "bundle exec rails server -b #{host} -d -p #{port} -e #{environment}",
118
118
  [:out] => '/dev/null'
119
119
  )
120
120
  Process.wait pid
@@ -148,6 +148,10 @@ class PerfCheck
148
148
  @running
149
149
  end
150
150
 
151
+ def environment
152
+ perf_check.options.environment || "development"
153
+ end
154
+
151
155
  class Profile < OpenStruct; end
152
156
 
153
157
  private
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: perf_check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.4
4
+ version: 0.10.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - rubytune
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-17 00:00:00.000000000 Z
11
+ date: 2019-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -116,8 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  requirements: []
119
- rubyforge_project:
120
- rubygems_version: 2.7.6
119
+ rubygems_version: 3.0.1
121
120
  signing_key:
122
121
  specification_version: 4
123
122
  summary: PERF CHECKKK!