ruby-metrics 0.8.0 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.bundle/config +2 -0
- data/Gemfile.lock +1 -3
- data/lib/ruby-metrics.rb +0 -6
- data/lib/ruby-metrics/statistics/exponential_sample.rb +2 -2
- data/lib/ruby-metrics/version.rb +1 -1
- data/ruby-metrics.gemspec +0 -1
- data/spec/instruments/meter_spec.rb +5 -5
- metadata +12 -24
data/.bundle/config
ADDED
data/Gemfile.lock
CHANGED
@@ -1,16 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ruby-metrics (0.8.
|
4
|
+
ruby-metrics (0.8.5)
|
5
5
|
json
|
6
|
-
quantity
|
7
6
|
|
8
7
|
GEM
|
9
8
|
remote: http://rubygems.org/
|
10
9
|
specs:
|
11
10
|
diff-lcs (1.1.2)
|
12
11
|
json (1.5.1)
|
13
|
-
quantity (0.1.1)
|
14
12
|
rack (1.2.2)
|
15
13
|
rack-test (0.5.7)
|
16
14
|
rack (>= 1.0)
|
data/lib/ruby-metrics.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# == Metrics Initialization
|
2
2
|
#
|
3
|
-
require 'quantity/all'
|
4
3
|
|
5
4
|
module Metrics
|
6
5
|
|
@@ -13,10 +12,5 @@ module Metrics
|
|
13
12
|
|
14
13
|
end
|
15
14
|
|
16
|
-
Quantity::Unit.add_unit :minute, :time, 60000, :minutes
|
17
|
-
Quantity::Unit.add_unit :hour, :time, 3600000, :hours
|
18
|
-
Quantity::Unit.add_unit :day, :time, 86400000, :days
|
19
|
-
Quantity::Unit.add_unit :week, :time, 604800000, :weeks
|
20
|
-
|
21
15
|
|
22
16
|
require File.join(File.dirname(__FILE__), 'ruby-metrics', 'agent')
|
data/lib/ruby-metrics/version.rb
CHANGED
data/ruby-metrics.gemspec
CHANGED
@@ -32,8 +32,8 @@ describe Metrics::Instruments::Meter do
|
|
32
32
|
@meter.tick()
|
33
33
|
end
|
34
34
|
|
35
|
-
def tick_for(
|
36
|
-
count = ((
|
35
|
+
def tick_for(seconds)
|
36
|
+
count = ((seconds) / 5).to_i
|
37
37
|
(1..count).each do
|
38
38
|
@meter.tick()
|
39
39
|
end
|
@@ -45,7 +45,7 @@ describe Metrics::Instruments::Meter do
|
|
45
45
|
end
|
46
46
|
|
47
47
|
it "should have a rate of 0.22072766470286553 events/sec after 1 minute" do
|
48
|
-
tick_for(
|
48
|
+
tick_for(60)
|
49
49
|
@meter.one_minute_rate.should == 0.22072766470286553
|
50
50
|
end
|
51
51
|
end
|
@@ -56,7 +56,7 @@ describe Metrics::Instruments::Meter do
|
|
56
56
|
end
|
57
57
|
|
58
58
|
it "should have a rate of 0.49123845184678905 events/sec after 1 minute" do
|
59
|
-
tick_for(
|
59
|
+
tick_for(60)
|
60
60
|
@meter.five_minute_rate.should == 0.49123845184678905
|
61
61
|
end
|
62
62
|
end
|
@@ -75,7 +75,7 @@ describe Metrics::Instruments::Meter do
|
|
75
75
|
end
|
76
76
|
|
77
77
|
it "should have a rate of 0.5613041910189706 events/sec after 1 minute" do
|
78
|
-
tick_for(
|
78
|
+
tick_for(60)
|
79
79
|
@meter.fifteen_minute_rate.should == 0.5613041910189706
|
80
80
|
end
|
81
81
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 8
|
8
|
-
-
|
9
|
-
version: 0.8.
|
8
|
+
- 5
|
9
|
+
version: 0.8.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- John Ewart
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-
|
17
|
+
date: 2011-05-11 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -30,22 +30,9 @@ dependencies:
|
|
30
30
|
type: :runtime
|
31
31
|
prerelease: false
|
32
32
|
version_requirements: *id001
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: quantity
|
35
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
36
|
-
none: false
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
segments:
|
41
|
-
- 0
|
42
|
-
version: "0"
|
43
|
-
type: :runtime
|
44
|
-
prerelease: false
|
45
|
-
version_requirements: *id002
|
46
33
|
- !ruby/object:Gem::Dependency
|
47
34
|
name: rspec
|
48
|
-
requirement: &
|
35
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
49
36
|
none: false
|
50
37
|
requirements:
|
51
38
|
- - ">="
|
@@ -55,10 +42,10 @@ dependencies:
|
|
55
42
|
version: "0"
|
56
43
|
type: :development
|
57
44
|
prerelease: false
|
58
|
-
version_requirements: *
|
45
|
+
version_requirements: *id002
|
59
46
|
- !ruby/object:Gem::Dependency
|
60
47
|
name: simplecov
|
61
|
-
requirement: &
|
48
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
62
49
|
none: false
|
63
50
|
requirements:
|
64
51
|
- - ">="
|
@@ -70,10 +57,10 @@ dependencies:
|
|
70
57
|
version: 0.3.8
|
71
58
|
type: :development
|
72
59
|
prerelease: false
|
73
|
-
version_requirements: *
|
60
|
+
version_requirements: *id003
|
74
61
|
- !ruby/object:Gem::Dependency
|
75
62
|
name: rack-test
|
76
|
-
requirement: &
|
63
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
77
64
|
none: false
|
78
65
|
requirements:
|
79
66
|
- - ">="
|
@@ -83,7 +70,7 @@ dependencies:
|
|
83
70
|
version: "0"
|
84
71
|
type: :development
|
85
72
|
prerelease: false
|
86
|
-
version_requirements: *
|
73
|
+
version_requirements: *id004
|
87
74
|
description: A Ruby implementation of metrics inspired by @coda's JVM metrics for those of us in Ruby land
|
88
75
|
email:
|
89
76
|
- john@johnewart.net
|
@@ -94,6 +81,7 @@ extensions: []
|
|
94
81
|
extra_rdoc_files: []
|
95
82
|
|
96
83
|
files:
|
84
|
+
- .bundle/config
|
97
85
|
- .gitignore
|
98
86
|
- .rvmrc
|
99
87
|
- Gemfile
|
@@ -160,7 +148,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
160
148
|
requirements:
|
161
149
|
- - ">="
|
162
150
|
- !ruby/object:Gem::Version
|
163
|
-
hash:
|
151
|
+
hash: -317001895156670469
|
164
152
|
segments:
|
165
153
|
- 0
|
166
154
|
version: "0"
|
@@ -169,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
157
|
requirements:
|
170
158
|
- - ">="
|
171
159
|
- !ruby/object:Gem::Version
|
172
|
-
hash:
|
160
|
+
hash: -317001895156670469
|
173
161
|
segments:
|
174
162
|
- 0
|
175
163
|
version: "0"
|