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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 689f372f6e0a6bd25ac8b3ca6c9a1378459020ba61044aa4fa3dca67911a2363
4
- data.tar.gz: c02c9c53ca5aa3e6469ea830534dc2c9a623f9c2bf105973df04c494920cd160
3
+ metadata.gz: 80d7f5f10f180e39fb577d32f65bb8589a490ab6af9ecce6950118ab796beb08
4
+ data.tar.gz: 06c25aae71670e1f11fec2c128ecc2095b643edd400e315385b0d94819e51e36
5
5
  SHA512:
6
- metadata.gz: f9191351090e9da616024a53040fce8f80331982fedcd165b36c19291ed59261fa0bb2afb61703d687145315b6e57eefbbaef9557b926b1cd0ff2b9d807f6443
7
- data.tar.gz: 330e785a95650ac8163af8f4eb06d73468541157d9836f4c433a1852b21731422703eba070b96f514ef6b933772fc0f883e1ff2fe0718e685030834a1402a778
6
+ metadata.gz: 7bdcefb60dc2b293fec7f81067b28ac2326ed2f4cdbb46bc3e006731c9624ff7edf770a82727e4ec568ad20f8c5fca9893a09109985a143faf8525c369556b06
7
+ data.tar.gz: b9e40ea61ee705fbeaa00920d2113e2d8bdc329a569ca139504885b8f91fb23021ace783c2da36617c11fee99b3a299c1ee8e3ce71dd81a1b743da14d0cac55d
@@ -1,5 +1,9 @@
1
1
  # A Log of Changes!
2
2
 
3
+ ## [1.3.4]
4
+
5
+ - Allow for "warming up tasks" via WARM_COUNT env var #119
6
+
3
7
  ## [1.3.3]
4
8
 
5
9
  - Make all paths added to $LOAD_PATH absolute instead of relative to allow for use with apps that use bootsnap.
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"
@@ -1,3 +1,3 @@
1
1
  module DerailedBenchmarks
2
- VERSION = "1.3.3"
2
+ VERSION = "1.3.4"
3
3
  end
@@ -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.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-07 00:00:00.000000000 Z
11
+ date: 2018-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: heapy