perf_check 0.10.4 → 0.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/perf_check.rb +2 -1
- data/lib/perf_check/config.rb +29 -16
- data/lib/perf_check/server.rb +5 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e7e73abde3ebfe2f92f12eed41e71cc0a1aebb0757bca2b633f0dfee228e3a9
|
4
|
+
data.tar.gz: 72f12606679f3f271637236bf5790d237cd4884c2802fc64eb2c7aacf285068d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f3ce1ff0e21efa6bca872cd7d51da8fcd2444b05e900556cb86be07a693c6721c86f68f97535f22bf2f3d7faf0a76d676ab50cb0ab6f1875c25e0242cb2fe7e
|
7
|
+
data.tar.gz: 36c0cb1e974bce896cda36d2a0f88dd549ed9a0e7e10b657ec9731244b5c9e77e00ecfc2363f06098182967da2c0f2db87ba208e33774ce3b4c52500d4f549f2
|
data/lib/perf_check.rb
CHANGED
data/lib/perf_check/config.rb
CHANGED
@@ -15,52 +15,65 @@ class PerfCheck
|
|
15
15
|
|
16
16
|
opts.separator "\nBenchmark options:"
|
17
17
|
opts.on('--requests N', '-n',
|
18
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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('--
|
38
|
-
|
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('--
|
42
|
-
|
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('--
|
46
|
-
|
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.
|
50
|
-
|
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('--
|
54
|
-
|
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('--
|
63
|
-
|
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|
|
data/lib/perf_check/server.rb
CHANGED
@@ -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
|
+
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-
|
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
|
-
|
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!
|