librato-metrics 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## Changelog
2
2
 
3
+ ### Version 0.7.3
4
+ * Allow prefixes to be changed after instantiation on Queues/Aggregators
5
+
3
6
  ### Version 0.7.2
4
7
  * Extend prefix option support to Aggregators
5
8
 
data/Gemfile CHANGED
@@ -4,7 +4,7 @@ platforms :jruby do
4
4
  gem 'jruby-openssl'
5
5
  end
6
6
 
7
- platforms :ruby do
7
+ platforms :ruby_19 do
8
8
  # make available for yard under C rubies
9
9
  gem 'redcarpet'
10
10
  end
@@ -5,6 +5,7 @@ module Librato
5
5
  MEASUREMENTS_PER_REQUEST = 500
6
6
 
7
7
  attr_reader :per_request, :last_submit_time
8
+ attr_accessor :prefix
8
9
 
9
10
  # The current Client instance this queue is using to authenticate
10
11
  # and connect to Librato Metrics. This will default to the primary
@@ -1,5 +1,5 @@
1
1
  module Librato
2
2
  module Metrics
3
- VERSION = "0.7.2"
3
+ VERSION = "0.7.3"
4
4
  end
5
5
  end
@@ -82,6 +82,24 @@ module Librato
82
82
  subject.queued.should equal_unordered(expected)
83
83
  end
84
84
  end
85
+
86
+ context "when dynamically changing prefix" do
87
+ it "should auto-append names" do
88
+ subject.add :bar => 12
89
+ subject.prefix = 'foo' # with string
90
+ subject.add :bar => 23
91
+ subject.prefix = :foo # with symbol
92
+ subject.add :bar => 34
93
+ subject.prefix = nil # unsetting
94
+ subject.add :bar => 45
95
+ expected = {:gauges => [
96
+ {:name => 'bar', :value => 12, :measure_time => @time},
97
+ {:name => 'foo.bar', :value => 23, :measure_time => @time},
98
+ {:name => 'foo.bar', :value => 34, :measure_time => @time},
99
+ {:name => 'bar', :value => 45, :measure_time => @time}]}
100
+ subject.queued.should equal_unordered(expected)
101
+ end
102
+ end
85
103
  end
86
104
 
87
105
  context "with multiple metrics" 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.2
4
+ version: 0.7.3
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-08 00:00:00.000000000 Z
12
+ date: 2012-10-16 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: 1969424366302856225
218
+ hash: -3606609391443233543
219
219
  required_rubygems_version: !ruby/object:Gem::Requirement
220
220
  none: false
221
221
  requirements: