evt-diagnostics-sample 0.1.0.0 → 0.1.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: b6d0f5e4778b4584977955ca08b46df3df2278447dc87eeb9155a27a7d87f79d
4
- data.tar.gz: cbc2304f16628b0e17520f0c73252c76cc733fbbb3357be4b9bbbd19e8af8aba
3
+ metadata.gz: d0bfa71e7155d416e8b5919a510eb42a29ad47e5eda3ea83301892f8bcc418be
4
+ data.tar.gz: d61d62a639d2d6984682a364133be0e33af4509fe59f3387c7a39acd0a9a23de
5
5
  SHA512:
6
- metadata.gz: fae5a8f6b0578d2c28f3fe7a68e0036b4acc23a410dca001296f0e275a08595b034f95f83471175bcbceb82cc7a807686c8b44c5a675db773c878282d2987f63
7
- data.tar.gz: 6d9c12df6b21dccb70534c67116201cab94e0eb1484d320e0763a88390a522eeec46795ab315cb3854474e5361a7e601ae1aeb40e1f9b12d3e1fe8073757c2b8
6
+ metadata.gz: 6220de6b74d5bd569917279c26ee0a656b29eca1dc290206af36091cb6811cd697770906e3efcbba24569d6c13e41ed851f6c5be82fb147a6c3df1130be8c2c2
7
+ data.tar.gz: dd3c09a188c28ef3aef40003763a6475273e6e277001e3f0017cd985501a994cd74388d6fa7b1209d0b226fd3847a0f71c71943aab6d99698429833e1f02274c
@@ -5,36 +5,55 @@ module Diagnostics
5
5
 
6
6
  attribute :cycles, Integer, default: 0
7
7
  attribute :cycle_time_milliseconds, Float, default: 0.0
8
+ attribute :cycle_time_sum_squares, Float, default: 0.0
9
+
8
10
  attribute :warmup_cycles, Integer, default: 0
9
11
  attribute :warmup_cycle_time_milliseconds, Float, default: 0.0
12
+ attribute :warmup_cycle_time_sum_squares, Float, default: 0.0
10
13
 
11
14
  def cycle(elapsed_time)
12
15
  self.cycle_time_milliseconds += elapsed_time
13
16
 
17
+ self.cycle_time_sum_squares += (elapsed_time ** 2)
18
+
14
19
  self.cycles += 1
15
20
  end
16
21
 
22
+ def mean_cycle_time_milliseconds
23
+ cycle_time_milliseconds / cycles
24
+ end
25
+
26
+ def cycle_frequency
27
+ cycles / (cycle_time_milliseconds / 1_000)
28
+ end
29
+
30
+ def cycle_time_standard_deviation
31
+ variance = (cycle_time_sum_squares / cycles) - (mean_cycle_time_milliseconds ** 2)
32
+
33
+ Math.sqrt(variance)
34
+ end
35
+
17
36
  def warmup_cycle(elapsed_time)
18
37
  self.warmup_cycle_time_milliseconds += elapsed_time
19
38
 
20
- self.warmup_cycles += 1
21
- end
39
+ self.warmup_cycle_time_sum_squares += (elapsed_time ** 2)
22
40
 
23
- def mean_cycle_time_milliseconds
24
- cycle_time_milliseconds / cycles
41
+ self.warmup_cycles += 1
25
42
  end
26
43
 
27
44
  def mean_warmup_cycle_time_milliseconds
28
45
  warmup_cycle_time_milliseconds / warmup_cycles
29
46
  end
30
47
 
31
- def cycle_frequency
32
- cycles / (cycle_time_milliseconds / 1_000)
33
- end
34
-
35
48
  def warmup_cycle_frequency
36
49
  warmup_cycles / (warmup_cycle_time_milliseconds / 1_000)
37
50
  end
51
+
52
+ def warmup_cycle_time_standard_deviation
53
+ variance = (warmup_cycle_time_sum_squares / warmup_cycles) - (mean_warmup_cycle_time_milliseconds ** 2)
54
+
55
+ Math.sqrt(variance)
56
+ end
38
57
  end
39
58
  end
40
59
  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.1.0.0
4
+ version: 0.1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Eventide Project