metriks 0.9.8.3 → 0.9.8.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/metriks.rb +1 -1
- data/lib/metriks/exponentially_decaying_sample.rb +13 -1
- data/metriks.gemspec +2 -2
- metadata +11 -11
data/lib/metriks.rb
CHANGED
@@ -80,7 +80,19 @@ module Metriks
|
|
80
80
|
@start_time = Time.now
|
81
81
|
@values.keys.each do |key|
|
82
82
|
value = @values.delete(key)
|
83
|
-
|
83
|
+
new_key = key * Math.exp(-@alpha * (@start_time - old_start_time))
|
84
|
+
|
85
|
+
if key.nan?
|
86
|
+
warn "ExponentiallyDecayingSample found a key of NaN. old_start_time: #{old_start_time.to_f} start_time: #{@start_time.to_f}"
|
87
|
+
next
|
88
|
+
end
|
89
|
+
|
90
|
+
if new_key.nan?
|
91
|
+
warn "ExponentiallyDecayingSample found a new_key of NaN. key: #{key} old_start_time: #{old_start_time.to_f} start_time: #{@start_time.to_f}"
|
92
|
+
next
|
93
|
+
end
|
94
|
+
|
95
|
+
@values[new_key] = value
|
84
96
|
end
|
85
97
|
end
|
86
98
|
end
|
data/metriks.gemspec
CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
|
|
13
13
|
## If your rubyforge_project name is different, then edit it and comment out
|
14
14
|
## the sub! line in the Rakefile
|
15
15
|
s.name = 'metriks'
|
16
|
-
s.version = '0.9.8.
|
17
|
-
s.date = '2012-05-
|
16
|
+
s.version = '0.9.8.4'
|
17
|
+
s.date = '2012-05-20'
|
18
18
|
|
19
19
|
## Make sure your summary is short. The description may be as long
|
20
20
|
## as you like.
|
metadata
CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
|
|
6
6
|
- 0
|
7
7
|
- 9
|
8
8
|
- 8
|
9
|
-
-
|
10
|
-
version: 0.9.8.
|
9
|
+
- 4
|
10
|
+
version: 0.9.8.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Eric Lindvall
|
@@ -15,10 +15,11 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-05-
|
18
|
+
date: 2012-05-20 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
+
type: :runtime
|
22
23
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
23
24
|
requirements:
|
24
25
|
- - ~>
|
@@ -27,11 +28,11 @@ dependencies:
|
|
27
28
|
- 1
|
28
29
|
- 0
|
29
30
|
version: "1.0"
|
30
|
-
requirement: *id001
|
31
31
|
name: atomic
|
32
|
+
requirement: *id001
|
32
33
|
prerelease: false
|
33
|
-
type: :runtime
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
|
+
type: :runtime
|
35
36
|
version_requirements: &id002 !ruby/object:Gem::Requirement
|
36
37
|
requirements:
|
37
38
|
- - ~>
|
@@ -40,11 +41,11 @@ dependencies:
|
|
40
41
|
- 1
|
41
42
|
- 1
|
42
43
|
version: "1.1"
|
43
|
-
requirement: *id002
|
44
44
|
name: hitimes
|
45
|
+
requirement: *id002
|
45
46
|
prerelease: false
|
46
|
-
type: :runtime
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
|
+
type: :runtime
|
48
49
|
version_requirements: &id003 !ruby/object:Gem::Requirement
|
49
50
|
requirements:
|
50
51
|
- - ~>
|
@@ -54,11 +55,11 @@ dependencies:
|
|
54
55
|
- 1
|
55
56
|
- 2
|
56
57
|
version: 1.1.2
|
57
|
-
requirement: *id003
|
58
58
|
name: avl_tree
|
59
|
+
requirement: *id003
|
59
60
|
prerelease: false
|
60
|
-
type: :runtime
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
|
+
type: :development
|
62
63
|
version_requirements: &id004 !ruby/object:Gem::Requirement
|
63
64
|
requirements:
|
64
65
|
- - ~>
|
@@ -67,10 +68,9 @@ dependencies:
|
|
67
68
|
- 0
|
68
69
|
- 10
|
69
70
|
version: "0.10"
|
70
|
-
requirement: *id004
|
71
71
|
name: mocha
|
72
|
+
requirement: *id004
|
72
73
|
prerelease: false
|
73
|
-
type: :development
|
74
74
|
description: An experimental metrics client.
|
75
75
|
email: eric@sevenscale.com
|
76
76
|
executables: []
|