metriks-dogstatsd 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock
CHANGED
@@ -122,16 +122,7 @@ module Metriks::Reporter
|
|
122
122
|
keys.flatten.each do |key|
|
123
123
|
name = key.to_s.gsub(/^get_/, '')
|
124
124
|
value = metric.send(key)
|
125
|
-
|
126
|
-
case type
|
127
|
-
when :meter, :counter
|
128
|
-
@client.count(base_name, value)
|
129
|
-
when :timer, :utilization_timer, :histogram
|
130
|
-
@client.histogram("#{base_name}.#{name}", value)
|
131
|
-
end
|
132
|
-
else
|
133
|
-
@client.gauge("#{base_name}.#{name}", value)
|
134
|
-
end
|
125
|
+
@client.gauge("#{base_name}.#{name}", value)
|
135
126
|
end
|
136
127
|
|
137
128
|
unless snapshot_keys.empty?
|
@@ -8,9 +8,9 @@ module Metriks
|
|
8
8
|
# The Major Version Number
|
9
9
|
MAJOR = '0'
|
10
10
|
# The Minor Version Number
|
11
|
-
MINOR = '
|
11
|
+
MINOR = '3'
|
12
12
|
# The Patch Version Number
|
13
|
-
PATCH = '
|
13
|
+
PATCH = '0'
|
14
14
|
|
15
15
|
# Converts the information stored in the Version module into a standards compliant
|
16
16
|
# version identification string
|
@@ -1,10 +1,12 @@
|
|
1
1
|
require 'helper'
|
2
2
|
require 'metriks/reporter/dogstatsd'
|
3
|
+
require 'logger'
|
3
4
|
|
4
5
|
class DogStatsdReporterTest < Test::Unit::TestCase
|
5
6
|
|
6
7
|
class UDPSocketInterceptor < UDPSocket
|
7
8
|
def self.send *args
|
9
|
+
puts "UDPINTERCEPT: #{args.inspect}"
|
8
10
|
# intercept and throw away any sent packets
|
9
11
|
end
|
10
12
|
end
|
@@ -31,8 +33,10 @@ class DogStatsdReporterTest < Test::Unit::TestCase
|
|
31
33
|
|
32
34
|
def test_meter
|
33
35
|
number_of_times_marked = 10
|
34
|
-
|
35
|
-
|
36
|
+
|
37
|
+
reporting = sequence('reporting')
|
38
|
+
@statsd_client.expects(:gauge).once.with('meter.testing.count', number_of_times_marked).in_sequence(reporting)
|
39
|
+
@statsd_client.expects(:gauge).at_least_once.in_sequence(reporting)
|
36
40
|
|
37
41
|
number_of_times_marked.times do
|
38
42
|
@registry.meter('meter.testing').mark
|
@@ -42,28 +46,38 @@ class DogStatsdReporterTest < Test::Unit::TestCase
|
|
42
46
|
end
|
43
47
|
|
44
48
|
def test_counter
|
45
|
-
|
49
|
+
|
50
|
+
@statsd_client.expects(:gauge).once.with('counter.testing.count', 1)
|
46
51
|
|
47
52
|
@registry.counter('counter.testing').increment
|
48
53
|
flush_reporter
|
49
54
|
end
|
50
55
|
|
51
56
|
def test_timer
|
52
|
-
|
53
|
-
|
57
|
+
|
58
|
+
reporting = sequence('reporting')
|
59
|
+
@statsd_client.expects(:gauge).once.with('timer.testing.count', 1).in_sequence(reporting)
|
60
|
+
@statsd_client.expects(:gauge).at_least_once.in_sequence(reporting)
|
61
|
+
|
54
62
|
@registry.timer('timer.testing').update(1.5)
|
55
63
|
flush_reporter
|
56
64
|
end
|
57
65
|
|
58
66
|
def test_histogram
|
59
|
-
|
67
|
+
|
68
|
+
reporting = sequence('reporting')
|
69
|
+
@statsd_client.expects(:gauge).once.with('histogram.testing.count', 1).in_sequence(reporting)
|
70
|
+
@statsd_client.expects(:gauge).at_least_once.in_sequence(reporting)
|
60
71
|
|
61
72
|
@registry.histogram('histogram.testing').update(1.5)
|
62
73
|
flush_reporter
|
63
74
|
end
|
64
75
|
|
65
76
|
def test_utilization_timer
|
66
|
-
|
77
|
+
|
78
|
+
reporting = sequence('reporting')
|
79
|
+
@statsd_client.expects(:gauge).once.with('utilization_timer.testing.count', 1).in_sequence(reporting)
|
80
|
+
@statsd_client.expects(:gauge).at_least_once.in_sequence(reporting)
|
67
81
|
|
68
82
|
@registry.utilization_timer('utilization_timer.testing').update(1.5)
|
69
83
|
flush_reporter
|
@@ -71,8 +85,10 @@ class DogStatsdReporterTest < Test::Unit::TestCase
|
|
71
85
|
|
72
86
|
def test_prefixing
|
73
87
|
setup :reporter_prefix => 'test.prefix.xyzzy'
|
74
|
-
|
75
|
-
|
88
|
+
|
89
|
+
reporting = sequence('reporting')
|
90
|
+
@statsd_client.expects(:gauge).once.with('test.prefix.xyzzy.test.prefixes.count', 1).in_sequence(reporting)
|
91
|
+
@statsd_client.expects(:gauge).at_least_once.in_sequence(reporting)
|
76
92
|
|
77
93
|
@registry.meter('test.prefixes').mark
|
78
94
|
flush_reporter
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metriks-dogstatsd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-12-
|
13
|
+
date: 2012-12-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: metriks
|