evt-diagnostics-sample 0.2.1.0 → 0.2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/diagnostics/sample.rb +1 -1
- data/lib/diagnostics/sample/measure.rb +2 -2
- data/lib/diagnostics/sample/sample.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59bf27312b5e697487459aad5eb87281b9e52ea876187df176ac9a6952032b86
|
4
|
+
data.tar.gz: 61eb387f63ccb5bef4756759f5596b43f358859d9504c6179ee8a0464781e0f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f20e7ce26b8d1aa9c48ac4844e60d4d89f5eb2793a14e6689094b7da419700e3f61ef575666389cce8e0c092dd21fb3fa62b3a4ec703d636e02b9d0eb126ee04
|
7
|
+
data.tar.gz: 6b3b14cbf089d37d0f0b46118a3db636b840ca7f8f124c346b4330095ec49676d3618119b23ec148e8439ec166d38a853419b02e31d0a6d64ac05d89897d0bf0
|
data/lib/diagnostics/sample.rb
CHANGED
@@ -8,8 +8,8 @@ require 'schema'
|
|
8
8
|
|
9
9
|
require 'diagnostics/sample/defaults'
|
10
10
|
require 'diagnostics/sample/log'
|
11
|
-
require 'diagnostics/sample/measure'
|
12
11
|
require 'diagnostics/sample/measure/clock'
|
12
|
+
require 'diagnostics/sample/measure'
|
13
13
|
require 'diagnostics/sample/result'
|
14
14
|
|
15
15
|
require 'diagnostics/sample/sample'
|
@@ -34,14 +34,14 @@ module Diagnostics
|
|
34
34
|
instance.()
|
35
35
|
end
|
36
36
|
|
37
|
-
def call
|
37
|
+
def call(arg=nil)
|
38
38
|
logger.trace { "Measuring action (GC: #{gc.inspect})" }
|
39
39
|
|
40
40
|
::GC.disable unless gc
|
41
41
|
|
42
42
|
start_time = clock.now
|
43
43
|
|
44
|
-
action.()
|
44
|
+
action.(arg)
|
45
45
|
|
46
46
|
end_time = clock.now
|
47
47
|
|
@@ -40,8 +40,8 @@ module Diagnostics
|
|
40
40
|
def call
|
41
41
|
logger.trace { "Starting warmup (Warmup Cycles: #{warmup_cycles})" }
|
42
42
|
|
43
|
-
warmup_cycles.times do
|
44
|
-
elapsed_time_nanoseconds = measure.()
|
43
|
+
warmup_cycles.times do |iteration|
|
44
|
+
elapsed_time_nanoseconds = measure.(iteration)
|
45
45
|
|
46
46
|
elapsed_time = milliseconds(elapsed_time_nanoseconds)
|
47
47
|
|
@@ -52,8 +52,8 @@ module Diagnostics
|
|
52
52
|
|
53
53
|
logger.trace { "Starting sample (Cycles: #{cycles}, Warmup Cycles: #{warmup_cycles})" }
|
54
54
|
|
55
|
-
cycles.times do
|
56
|
-
elapsed_time_nanoseconds = measure.()
|
55
|
+
cycles.times do |iteration|
|
56
|
+
elapsed_time_nanoseconds = measure.(iteration + self.warmup_cycles)
|
57
57
|
|
58
58
|
elapsed_time = milliseconds(elapsed_time_nanoseconds)
|
59
59
|
|