derailed_benchmarks 1.3.3 → 1.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +10 -0
- data/lib/derailed_benchmarks/tasks.rb +5 -0
- data/lib/derailed_benchmarks/version.rb +1 -1
- data/test/integration/tasks_test.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80d7f5f10f180e39fb577d32f65bb8589a490ab6af9ecce6950118ab796beb08
|
4
|
+
data.tar.gz: 06c25aae71670e1f11fec2c128ecc2095b643edd400e315385b0d94819e51e36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bdcefb60dc2b293fec7f81067b28ac2326ed2f4cdbb46bc3e006731c9624ff7edf770a82727e4ec568ad20f8c5fca9893a09109985a143faf8525c369556b06
|
7
|
+
data.tar.gz: b9e40ea61ee705fbeaa00920d2113e2d8bdc329a569ca139504885b8f91fb23021ace783c2da36617c11fee99b3a299c1ee8e3ce71dd81a1b743da14d0cac55d
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -402,6 +402,16 @@ For tasks that are run a number of times you can set the number using `TEST_COUN
|
|
402
402
|
$ TEST_COUNT=100_000 bundle exec derailed exec perf:test
|
403
403
|
```
|
404
404
|
|
405
|
+
### Warming up your app before measuring with `WARM_COUNT`
|
406
|
+
|
407
|
+
When you are measuring the long term performance of an application, especially if you're using jit you may want to let the application "warm up" without measuring this time. To allow for this you can specify `WARM_COUNT` and the application will be called that number of times before any measurements are taken.
|
408
|
+
|
409
|
+
```
|
410
|
+
$ WARM_COUNT=5_000 bundle exec derailed exec perf:test
|
411
|
+
Warming up app: 5000 times
|
412
|
+
# ...
|
413
|
+
```
|
414
|
+
|
405
415
|
### Hitting a different endpoint with `PATH_TO_HIT`
|
406
416
|
|
407
417
|
By default tasks will hit your homepage `/`. If you want to hit a different url use `PATH_TO_HIT` for example if you wanted to go to `users/new` you can execute:
|
@@ -62,6 +62,7 @@ namespace :perf do
|
|
62
62
|
Rake::Task["perf:rack_load"].invoke
|
63
63
|
end
|
64
64
|
|
65
|
+
WARM_COUNT = (ENV['WARM_COUNT'] || 0).to_i
|
65
66
|
TEST_COUNT = (ENV['TEST_COUNT'] || ENV['CNT'] || 1_000).to_i
|
66
67
|
PATH_TO_HIT = ENV["PATH_TO_HIT"] || ENV['ENDPOINT'] || "/"
|
67
68
|
puts "Endpoint: #{ PATH_TO_HIT.inspect }"
|
@@ -106,6 +107,10 @@ namespace :perf do
|
|
106
107
|
response
|
107
108
|
end
|
108
109
|
end
|
110
|
+
if WARM_COUNT > 0
|
111
|
+
puts "Warming up app: #{WARM_COUNT} times"
|
112
|
+
WARM_COUNT.times { call_app }
|
113
|
+
end
|
109
114
|
end
|
110
115
|
|
111
116
|
desc "hits the url TEST_COUNT times"
|
@@ -51,6 +51,11 @@ class TasksTest < ActiveSupport::TestCase
|
|
51
51
|
assert_match "1 requests", result
|
52
52
|
end
|
53
53
|
|
54
|
+
test 'WARM_COUNT' do
|
55
|
+
result = rake "perf:test", env: { "WARM_COUNT" => 1 }
|
56
|
+
assert_match "Warming up app:", result
|
57
|
+
end
|
58
|
+
|
54
59
|
test 'PATH_TO_HIT' do
|
55
60
|
env = { "PATH_TO_HIT" => 'foo', "TEST_COUNT" => "2" }
|
56
61
|
result = rake "perf:test", env: env
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: derailed_benchmarks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Schneeman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: heapy
|