evt-diagnostics-sample 0.2.0.1 → 0.2.1.0

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: b400c450de69084142338110fdc1687b0e30204e688df19564dc286200cd175c
4
- data.tar.gz: 56408c4726f0d19ee521498aa6b07f5eca53afe0cf674f651dbcb265bec9713c
3
+ metadata.gz: 134ba02775d5b826e4f3fda67922123d60d71f7a2a7bd9f8a5ab288364f83435
4
+ data.tar.gz: 88fd2fe5929b34c46d776135a094ea11d0d85ede59596ca03b189bc5f660051e
5
5
  SHA512:
6
- metadata.gz: da268224a96d0dc3c74cd2bf70a0c994cfc27bbb3e4b2218effa35a4ce59cf4358d250a19cbeac04e9db769107ced5a424f29e515abd9eebed2b0ebe65486441
7
- data.tar.gz: ef009704feb327495c3b672b208c8fdee147baba71df2df2b40091601807a7ead783ebbeb4089bc1d58199d8ae8521497719ba2a59138498115431858407cc4a
6
+ metadata.gz: 32e5180484ae331265c2f662163179ed202d2285b8a68ec47b817190f0930c3b17ae143b3a22a989619c4ebd88d4ed6eafa1c74182c27c721b04009150f6ccee
7
+ data.tar.gz: 39b890d8aeaaa742f557e4cc747803c5efbc5cefa117b8fbf91e6150dca885443ef7aea095e1cd57bd6aaec69440e12546d296116020295d29a7e1882b6a2b0a
@@ -2,28 +2,32 @@ module Diagnostics
2
2
  class Sample
3
3
  module Controls
4
4
  module Result
5
+ extend StandardDeviation::Values
6
+ extend self
7
+
5
8
  def self.example
6
9
  result = Sample::Result.new
7
10
 
8
- StandardDeviation::Values.example.each do |value|
11
+ values.each do |value|
9
12
  result.cycle(value)
10
13
  end
11
14
 
12
15
  result
13
16
  end
14
17
 
18
+ def standard_deviation
19
+ StandardDeviation::Result.example
20
+ end
21
+
15
22
  module Digest
16
- def self.example
17
- values = [
18
- StandardDeviation::Values.sum,
19
- StandardDeviation::Values.mean,
20
- StandardDeviation::Result.example,
21
- StandardDeviation::Values.frequency
22
- ]
23
+ extend StandardDeviation::Values
24
+ extend Result
23
25
 
24
- <<~TEXT % values
25
- Cycle Time: %fms
26
- Mean Cycle Time: %fms (± %fms)
26
+ def self.example
27
+ <<~TEXT % [count, sum, mean, standard_deviation, frequency]
28
+ Cycles: %d
29
+ Time: %fms
30
+ Mean Time: %fms (± %fms)
27
31
  Cycles Per Second: %f
28
32
  TEXT
29
33
  end
@@ -4,19 +4,29 @@ module Diagnostics
4
4
  module StandardDeviation
5
5
  # Source: https://en.wikipedia.org/wiki/Standard_deviation#Population_standard_deviation_of_grades_of_eight_students (Nathan Ladd, Wed 30 May 2018)
6
6
  module Values
7
+ extend self
8
+
7
9
  def self.example
10
+ values
11
+ end
12
+
13
+ def values
8
14
  [2, 4, 4, 4, 5, 5, 7, 9]
9
15
  end
10
16
 
11
- def self.sum
17
+ def count
18
+ values.count
19
+ end
20
+
21
+ def sum
12
22
  40
13
23
  end
14
24
 
15
- def self.mean
25
+ def mean
16
26
  5
17
27
  end
18
28
 
19
- def self.frequency
29
+ def frequency
20
30
  200
21
31
  end
22
32
  end
@@ -11,6 +11,8 @@ module Diagnostics
11
11
  attribute :warmup_cycle_time_milliseconds, Float, default: 0.0
12
12
  attribute :warmup_cycle_time_sum_squares, Float, default: 0.0
13
13
 
14
+ alias_method :total_time_milliseconds, :cycle_time_milliseconds
15
+
14
16
  def cycle(elapsed_time)
15
17
  self.cycle_time_milliseconds += elapsed_time
16
18
 
@@ -57,9 +59,10 @@ module Diagnostics
57
59
  end
58
60
 
59
61
  def digest
60
- <<~TEXT % [cycle_time_milliseconds, mean_cycle_time_milliseconds, standard_deviation, cycles_per_second]
61
- Cycle Time: %fms
62
- Mean Cycle Time: %fms (± %fms)
62
+ <<~TEXT % [cycles, total_time_milliseconds, mean_cycle_time_milliseconds, standard_deviation, cycles_per_second]
63
+ Cycles: %d
64
+ Time: %fms
65
+ Mean Time: %fms (± %fms)
63
66
  Cycles Per Second: %f
64
67
  TEXT
65
68
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evt-diagnostics-sample
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.1
4
+ version: 0.2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Eventide Project