librato-metrics 0.7.1 → 0.7.2

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.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## Changelog
2
2
 
3
+ ### Version 0.7.2
4
+ * Extend prefix option support to Aggregators
5
+
3
6
  ### Version 0.7.1
4
7
  * Add prefix option to Queues
5
8
 
@@ -22,6 +22,9 @@ module Librato
22
22
  # @return [Aggregator] returns self
23
23
  def add(measurements)
24
24
  measurements.each do |metric, data|
25
+ if @prefix
26
+ metric = "#{@prefix}.#{metric}"
27
+ end
25
28
  if data.respond_to?(:each) # hash form
26
29
  value = data[:value]
27
30
  if data[:source]
@@ -1,5 +1,5 @@
1
1
  module Librato
2
2
  module Metrics
3
- VERSION = "0.7.1"
3
+ VERSION = "0.7.2"
4
4
  end
5
5
  end
@@ -90,6 +90,24 @@ module Librato
90
90
  ]}
91
91
  subject.queued.should equal_unordered(expected)
92
92
  end
93
+
94
+ context "with a prefix set" do
95
+ it "should auto-prepend names" do
96
+ subject = Aggregator.new(:prefix => 'foo')
97
+ subject.add :bar => 1
98
+ subject.add :bar => 12
99
+ expected = {:gauges => [
100
+ { :name =>'foo.bar',
101
+ :count => 2,
102
+ :sum => 13.0,
103
+ :min => 1.0,
104
+ :max => 12.0
105
+ }
106
+ ]
107
+ }
108
+ subject.queued.should equal_unordered(expected)
109
+ end
110
+ end
93
111
  end
94
112
 
95
113
  context "with multiple hash arguments" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: librato-metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-01 00:00:00.000000000 Z
12
+ date: 2012-10-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -215,7 +215,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
215
215
  version: '0'
216
216
  segments:
217
217
  - 0
218
- hash: -2663483251500342035
218
+ hash: 1969424366302856225
219
219
  required_rubygems_version: !ruby/object:Gem::Requirement
220
220
  none: false
221
221
  requirements: