metricize 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/metricize/forwarder.rb +1 -2
- data/lib/metricize/version.rb +1 -1
- data/spec/lib/metricize_spec.rb +3 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11b9ae196c2d2bcad3ff04ae224c63088fb29e11
|
4
|
+
data.tar.gz: 60b74ef5f38a7913d87673343ba9e14e7cc79e03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c8acaafe1f44c9f64fc64fd4a5517290db45cef43b222584711c375f01150c2fee2b4f18bae55ce526f44a3e1f9a7dca35a5ade9d41f5605c9acd2b39f1db24
|
7
|
+
data.tar.gz: 9c84fe2d4baa5ec3198e491f768358622afb577c4227736116459d5724e14cab4365407a20701c31ac2a962da6210a0cd7c5dfa48ff4092d24979fe0867fc330
|
data/lib/metricize/forwarder.rb
CHANGED
@@ -58,7 +58,6 @@ module Metricize
|
|
58
58
|
counters, measurements = metrics.partition {|metric| metric.fetch(:name) =~ /.count$/ }
|
59
59
|
counters = consolidate_counts(counters)
|
60
60
|
measurements = add_value_stats(measurements)
|
61
|
-
measurements << add_stat_by_key(@queue_name + '.counters', counters.size)
|
62
61
|
{ :gauges => counters + measurements, :measure_time => Time.now.to_i }
|
63
62
|
end
|
64
63
|
|
@@ -89,12 +88,12 @@ module Metricize
|
|
89
88
|
with_error_handling do
|
90
89
|
print_histogram(key, values)
|
91
90
|
end
|
91
|
+
gauges << add_stat_by_key(key, values.size, '.count').merge(counter_attributes)
|
92
92
|
[0.50, 0.95].each do |p|
|
93
93
|
percentile = values.extend(Stats).calculate_percentile(p)
|
94
94
|
gauges << add_stat_by_key(key, percentile, ".#{(p*100).to_i}e")
|
95
95
|
end
|
96
96
|
end
|
97
|
-
gauges << add_stat_by_key(@queue_name + '.measurements', value_groups.size)
|
98
97
|
gauges
|
99
98
|
end
|
100
99
|
|
data/lib/metricize/version.rb
CHANGED
data/spec/lib/metricize_spec.rb
CHANGED
@@ -165,13 +165,11 @@ describe Metricize do
|
|
165
165
|
forwarder.go!
|
166
166
|
end
|
167
167
|
|
168
|
-
it "adds
|
169
|
-
|
170
|
-
(1..7).each { |index| client.increment("counter_stat#{index}") }
|
168
|
+
it "adds the count of measurements to gauges" do
|
169
|
+
[4,5,6].each { |value| client.measure('value1', value) }
|
171
170
|
RestClient.should_receive(:post).with do | url, post_data |
|
172
171
|
gauges = JSON.parse(post_data)['gauges']
|
173
|
-
expect(gauges).to include("name"=>"
|
174
|
-
expect(gauges).to include("name"=>"metricize_queue.counters", "value"=>7)
|
172
|
+
expect(gauges).to include("name"=>"prefix.value1.count", "value"=>3, "attributes"=>{"source_aggregate"=>true, "summarize_function"=>"sum"})
|
175
173
|
end
|
176
174
|
forwarder.go!
|
177
175
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metricize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt McNeil
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|