statsd-instrument 1.7.1 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,4 +1,5 @@
1
1
  source "http://rubygems.org"
2
2
  gemspec
3
3
 
4
- gem 'SystemTimer', :platform => :mri_18, :require => ''
4
+ gem 'SystemTimer', :require => nil, :platform => :mri_18
5
+ gem 'rake', '~> 10.0.0' if RUBY_VERSION.to_f < 1.9
@@ -223,6 +223,7 @@ module StatsD
223
223
  end
224
224
 
225
225
  def clean_tags(tags)
226
+ tags = tags.map { |k, v| "#{k}:#{v}" } if tags.is_a?(Hash)
226
227
  tags.map do |tag|
227
228
  components = tag.split(':', 2)
228
229
  components.map { |c| c.gsub(/[^\w\.-]+/, '_') }.join(':')
@@ -1,5 +1,5 @@
1
1
  module StatsD
2
2
  module Instrument
3
- VERSION = "1.7.1"
3
+ VERSION = "1.7.2"
4
4
  end
5
5
  end
data/test/statsd_test.rb CHANGED
@@ -146,8 +146,14 @@ class StatsDTest < Test::Unit::TestCase
146
146
  assert_equal ['igno_red'], StatsD.send(:clean_tags, ['igno red'])
147
147
  assert_equal ['test:test_test'], StatsD.send(:clean_tags, ['test:test:test'])
148
148
 
149
+ assert_equal ['tag:value'], StatsD.send(:clean_tags, { :tag => 'value' })
150
+ assert_equal Set['tag:value', 'tag2:value2'], Set.new(StatsD.send(:clean_tags, { :tag => 'value', :tag2 => 'value2' }))
151
+
149
152
  StatsD.expects(:write_packet).with("fooc:3|c|#topic:foo_foo,bar_")
150
153
  StatsD.increment('fooc', 3, 1.0, ['topic:foo : foo', 'bar '])
154
+
155
+ StatsD.expects(:write_packet).with("foot:1|c|#foo:bar")
156
+ StatsD.increment('foot', :tags => { :foo => 'bar' })
151
157
  end
152
158
 
153
159
  def test_supports_key_value_syntax_on_statsite
data/test/test_helper.rb CHANGED
@@ -2,6 +2,7 @@ require 'rubygems'
2
2
  require 'statsd-instrument'
3
3
  require 'test/unit'
4
4
  require 'mocha/setup'
5
-
5
+ require 'set'
6
6
  require 'logger'
7
+
7
8
  StatsD.logger = Logger.new('/dev/null')
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statsd-instrument
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.7.2
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Jesse Storimer
@@ -9,34 +10,38 @@ authors:
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2014-03-20 00:00:00.000000000 Z
13
+ date: 2014-03-28 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: rake
16
17
  requirement: !ruby/object:Gem::Requirement
18
+ none: false
17
19
  requirements:
18
- - - '>='
20
+ - - ! '>='
19
21
  - !ruby/object:Gem::Version
20
22
  version: '0'
21
23
  type: :development
22
24
  prerelease: false
23
25
  version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
24
27
  requirements:
25
- - - '>='
28
+ - - ! '>='
26
29
  - !ruby/object:Gem::Version
27
30
  version: '0'
28
31
  - !ruby/object:Gem::Dependency
29
32
  name: mocha
30
33
  requirement: !ruby/object:Gem::Requirement
34
+ none: false
31
35
  requirements:
32
- - - '>='
36
+ - - ! '>='
33
37
  - !ruby/object:Gem::Version
34
38
  version: '0'
35
39
  type: :development
36
40
  prerelease: false
37
41
  version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
38
43
  requirements:
39
- - - '>='
44
+ - - ! '>='
40
45
  - !ruby/object:Gem::Version
41
46
  version: '0'
42
47
  description: A StatsD client for Ruby appspec. Provides metaprogramming methods to
@@ -63,29 +68,29 @@ files:
63
68
  homepage: https://github.com/Shopify/statsd-instrument
64
69
  licenses:
65
70
  - MIT
66
- metadata: {}
67
71
  post_install_message:
68
72
  rdoc_options: []
69
73
  require_paths:
70
74
  - lib
71
75
  required_ruby_version: !ruby/object:Gem::Requirement
76
+ none: false
72
77
  requirements:
73
- - - '>='
78
+ - - ! '>='
74
79
  - !ruby/object:Gem::Version
75
80
  version: '0'
76
81
  required_rubygems_version: !ruby/object:Gem::Requirement
82
+ none: false
77
83
  requirements:
78
- - - '>='
84
+ - - ! '>='
79
85
  - !ruby/object:Gem::Version
80
86
  version: '0'
81
87
  requirements: []
82
88
  rubyforge_project:
83
- rubygems_version: 2.0.3
89
+ rubygems_version: 1.8.23
84
90
  signing_key:
85
- specification_version: 4
91
+ specification_version: 3
86
92
  summary: A StatsD client for Ruby apps
87
93
  test_files:
88
94
  - test/statsd_instrumentation_test.rb
89
95
  - test/statsd_test.rb
90
96
  - test/test_helper.rb
91
- has_rdoc:
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: d876cdbfdf75b93666d453625ac0815a1116b339
4
- data.tar.gz: 5a71079949e6cd1590a2b0727bdf6046afa31f55
5
- SHA512:
6
- metadata.gz: 946343e9a9addc72ed9374279106652b5102d934d6630943e0dd171ddfa3f5c3ca59f66ed0f2ed16c84119d894468e94dcb0be25f771ce1fb97164f69ad8fd06
7
- data.tar.gz: 6b6e8a11472452f9cb386e3c8bec4ddfdafe8acb67e3bc066dbcf841af94cbfe983e2f6f8182c36ce877aa3b05503d230e4f8aa62e61c7ae129089b611a8e98f