rubycut-metriks 0.9.9.7 → 0.9.9.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/metriks/reporter/opentsdb.rb +8 -3
- data/metriks.gemspec +2 -2
- data/test/opentsdb_metrics_reporter_test.rb +2 -1
- metadata +4 -4
@@ -102,9 +102,14 @@ module Metriks::Reporter
|
|
102
102
|
end
|
103
103
|
def send_metric(compound_name, metric, keys, snapshot_keys = [])
|
104
104
|
name, tags = compound_name.split("#")
|
105
|
-
keys.
|
106
|
-
puts "put #{name}
|
107
|
-
connection.puts("put #{name}
|
105
|
+
if keys.size == 1
|
106
|
+
puts "put #{name} #{Time.now.to_i} #{metric.send(keys.first)} #{tags}"
|
107
|
+
connection.puts("put #{name} #{Time.now.to_i} #{metric.send(keys.first)} #{tags}")
|
108
|
+
else
|
109
|
+
keys.each do |key|
|
110
|
+
puts "put #{name}.#{key} #{Time.now.to_i} #{metric.send(key)} #{tags}"
|
111
|
+
connection.puts("put #{name}.#{key} #{Time.now.to_i} #{metric.send(key)} #{tags}")
|
112
|
+
end
|
108
113
|
end
|
109
114
|
end
|
110
115
|
end
|
data/metriks.gemspec
CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
|
|
13
13
|
## If your rubyforge_project name is different, then edit it and comment out
|
14
14
|
## the sub! line in the Rakefile
|
15
15
|
s.name = 'rubycut-metriks'
|
16
|
-
s.version = '0.9.9.
|
17
|
-
s.date = '2013-05-
|
16
|
+
s.version = '0.9.9.8'
|
17
|
+
s.date = '2013-05-30'
|
18
18
|
|
19
19
|
## Make sure your summary is short. The description may be as long
|
20
20
|
## as you like.
|
@@ -34,7 +34,8 @@ class OpentsdbReporterTest < Test::Unit::TestCase
|
|
34
34
|
tcp_socket.expects(:ready?).returns(false)
|
35
35
|
tcp_socket.expects(:close)
|
36
36
|
|
37
|
-
@reporter.connection.expects(:puts).with("put counter.testing
|
37
|
+
@reporter.connection.expects(:puts).with("put counter.testing #{Time.now.to_i} 1 tag=test")
|
38
|
+
@reporter.connection.expects(:puts).with("put gauge.testing #{Time.now.to_i} 123 tag=test")
|
38
39
|
@reporter.write
|
39
40
|
end
|
40
41
|
def test_reset
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubycut-metriks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 51
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
9
|
- 9
|
10
|
-
-
|
11
|
-
version: 0.9.9.
|
10
|
+
- 8
|
11
|
+
version: 0.9.9.8
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Eric Lindvall
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2013-05-
|
19
|
+
date: 2013-05-30 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: atomic
|