continuum 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/.rvmrc +1 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +32 -0
- data/README.md +47 -0
- data/Rakefile +20 -0
- data/continuum.gemspec +26 -0
- data/lib/continuum/client.rb +170 -0
- data/lib/continuum/version.rb +4 -0
- data/lib/continuum.rb +51 -0
- data/test/cassettes/aggregators.yml +24 -0
- data/test/cassettes/logs.yml +24 -0
- data/test/cassettes/query_ascii.yml +10175 -0
- data/test/cassettes/query_json.yml +24 -0
- data/test/cassettes/query_png.yml +263 -0
- data/test/cassettes/stats.yml +24 -0
- data/test/cassettes/suggest.yml +24 -0
- data/test/cassettes/version.yml +24 -0
- data/test/test_client.rb +155 -0
- data/test/test_helper.rb +15 -0
- metadata +139 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: http://10.3.172.58:4242/q?json=true&start=2h-ago&m=sum:rate:proc.net.bytes&m=sum:rate:proc.stat.cpu
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
accept:
|
9
|
+
- application/json
|
10
|
+
connection:
|
11
|
+
- keep-alive
|
12
|
+
keep-alive:
|
13
|
+
- 30
|
14
|
+
response: !ruby/struct:VCR::Response
|
15
|
+
status: !ruby/struct:VCR::ResponseStatus
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
content-type:
|
20
|
+
- application/json
|
21
|
+
content-length:
|
22
|
+
- "75"
|
23
|
+
body: "{\"plotted\":611,\"points\":1719,\"etags\":[[\"direction\"],[\"type\"]],\"timing\":294}"
|
24
|
+
http_version: "1.1"
|
@@ -0,0 +1,263 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: http://10.3.172.58:4242/q?start=2011/05/12-09:44:29&m=sum:rate:proc.net.bytes&m=sum:rate:proc.stat.cpu&png=true
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
accept:
|
9
|
+
-
|
10
|
+
connection:
|
11
|
+
- keep-alive
|
12
|
+
keep-alive:
|
13
|
+
- 30
|
14
|
+
response: !ruby/struct:VCR::Response
|
15
|
+
status: !ruby/struct:VCR::ResponseStatus
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
content-type:
|
20
|
+
- image/png
|
21
|
+
age:
|
22
|
+
- "0"
|
23
|
+
cache-control:
|
24
|
+
- max-age=25
|
25
|
+
content-length:
|
26
|
+
- "10502"
|
27
|
+
body: !binary |
|
28
|
+
iVBORw0KGgoAAAANSUhEUgAABAAAAAMACAMAAACNZOU/AAABMlBMVEX///8A
|
29
|
+
AACgoKD/AAAAwAAAgP/AAP8A7u7AQADIyABBaeH/wCAAgEDAgP8wYICLAABA
|
30
|
+
gAD/gP9//9SlKir//wBA4NAAAAAaGhozMzNNTU1mZmZ/f3+ZmZmzs7PAwMDM
|
31
|
+
zMzl5eX////wMjKQ7pCt2ObwVfDg///u3YL/tsGv7u7/1wAA/wAAZAAA/38i
|
32
|
+
iyIui1cAAP8AAIsZGXAAAIAAAM2HzusA////AP8AztH/FJP/f1DwgID/RQD6
|
33
|
+
gHLplnrw5oy9t2u4hgv19dyggCD/pQDugu6UANPdoN2QUEBVay+AFACAFBSA
|
34
|
+
QBSAQICAYMCAYP+AgAD/gED/oED/oGD/oHD/wMD//4D//8DNt57w//Cgts3B
|
35
|
+
/8HNwLB8/0Cg/yC+vr6/v78/Pz/f398fHx9fX1+fn5/U+i2qAAAgAElEQVR4
|
36
|
+
nO2dC5aqOBRFoexZODk+Ov8ptMA1wV8FX4Vwkuy9VvMoFM7VyjmSK0U3DQAA
|
37
|
+
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOTPcGn9D+ex7bsPT+x6e2y4jONl
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KRkHm4DYMh3TK+368dxlMBM47A+XLu4k6YiB
|
255
|
+
MRXQHaV8s2PqIXnjfDvzOSgA5ilx8tc8jbB5eF/TnwFM3OaZo/51AIf1AAbn
|
256
|
+
htRv0tl64f01ufLlqYSk3H7VRwTAMAzX6eVeLsHnxmW4fQTf5v9d+vaWvu1X
|
257
|
+
HPYtwPU+IJK/XfeTj0t65W7+55raCwtD+hd8e8l9P479NAdJfz58nYb2mH5o
|
258
|
+
ZxUAAAAHQl4CHM9hPjwuAFBGuVTl7yEAUEa5GOXvqeY6gFUNKKNcqPJWDvPh
|
259
|
+
cdcBHHgJEsooi3GYD4+7DuC46EEZZTWO8+Fh1wEc95JRRlmO467HOYzjXjLK
|
260
|
+
KAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACADP8DMT/0
|
261
|
+
yinChhUAAAAASUVORK5CYII=
|
262
|
+
|
263
|
+
http_version: "1.1"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: http://10.3.172.58:4242/stats?json
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
accept:
|
9
|
+
-
|
10
|
+
connection:
|
11
|
+
- keep-alive
|
12
|
+
keep-alive:
|
13
|
+
- 30
|
14
|
+
response: !ruby/struct:VCR::Response
|
15
|
+
status: !ruby/struct:VCR::ResponseStatus
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
content-type:
|
20
|
+
- application/json
|
21
|
+
content-length:
|
22
|
+
- "2918"
|
23
|
+
body: "[\"tsd.connectionmgr.connections 1305305539 8 host=i-00000106\",\"tsd.connectionmgr.exceptions 1305305539 0 host=i-00000106\",\"tsd.rpc.received 1305305539 118653 type=telnet host=i-00000106\",\"tsd.rpc.received 1305305539 8 type=http host=i-00000106\",\"tsd.rpc.exceptions 1305305539 0 host=i-00000106\",\"tsd.http.latency_50pct 1305305539 4 type=all host=i-00000106\",\"tsd.http.latency_75pct 1305305539 6 type=all host=i-00000106\",\"tsd.http.latency_90pct 1305305539 8 type=all host=i-00000106\",\"tsd.http.latency_95pct 1305305539 8 type=all host=i-00000106\",\"tsd.http.latency_50pct 1305305539 0 type=graph host=i-00000106\",\"tsd.http.latency_75pct 1305305539 0 type=graph host=i-00000106\",\"tsd.http.latency_90pct 1305305539 0 type=graph host=i-00000106\",\"tsd.http.latency_95pct 1305305539 0 type=graph host=i-00000106\",\"tsd.http.latency_50pct 1305305539 0 type=gnuplot host=i-00000106\",\"tsd.http.latency_75pct 1305305539 0 type=gnuplot host=i-00000106\",\"tsd.http.latency_90pct 1305305539 0 type=gnuplot host=i-00000106\",\"tsd.http.latency_95pct 1305305539 0 type=gnuplot host=i-00000106\",\"tsd.http.graph.requests 1305305539 0 cache=disk host=i-00000106\",\"tsd.http.graph.requests 1305305539 0 cache=miss host=i-00000106\",\"tsd.rpc.received 1305305539 118573 type=put host=i-00000106\",\"tsd.rpc.errors 1305305539 0 type=hbase_errors host=i-00000106\",\"tsd.rpc.errors 1305305539 0 type=invalid_values host=i-00000106\",\"tsd.rpc.errors 1305305539 0 type=illegal_arguments host=i-00000106\",\"tsd.rpc.errors 1305305539 34200 type=unknown_metrics host=i-00000106\",\"tsd.uid.cache-hit 1305305539 916 kind=metrics host=i-00000106\",\"tsd.uid.cache-miss 1305305539 34228 kind=metrics host=i-00000106\",\"tsd.uid.cache-size 1305305539 56 kind=metrics host=i-00000106\",\"tsd.uid.cache-hit 1305305539 4516 kind=tagk host=i-00000106\",\"tsd.uid.cache-miss 1305305539 10 kind=tagk host=i-00000106\",\"tsd.uid.cache-size 1305305539 20 kind=tagk host=i-00000106\",\"tsd.uid.cache-hit 1305305539 4459 kind=tagv host=i-00000106\",\"tsd.uid.cache-miss 1305305539 67 kind=tagv host=i-00000106\",\"tsd.uid.cache-size 1305305539 134 kind=tagv host=i-00000106\",\"tsd.jvm.ramfree 1305305539 20324560 host=i-00000106\",\"tsd.jvm.ramused 1305305539 38137856 host=i-00000106\",\"tsd.hbase.latency_50pct 1305305539 612 method=put host=i-00000106 class=IncomingDataPoints\",\"tsd.hbase.latency_75pct 1305305539 1124 method=put host=i-00000106 class=IncomingDataPoints\",\"tsd.hbase.latency_90pct 1305305539 1124 method=put host=i-00000106 class=IncomingDataPoints\",\"tsd.hbase.latency_95pct 1305305539 1124 method=put host=i-00000106 class=IncomingDataPoints\",\"tsd.hbase.latency_50pct 1305305539 0 method=scan host=i-00000106 class=TsdbQuery\",\"tsd.hbase.latency_75pct 1305305539 0 method=scan host=i-00000106 class=TsdbQuery\",\"tsd.hbase.latency_90pct 1305305539 0 method=scan host=i-00000106 class=TsdbQuery\",\"tsd.hbase.latency_95pct 1305305539 0 method=scan host=i-00000106 class=TsdbQuery\"]"
|
24
|
+
http_version: "1.1"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: http://10.3.172.58:4242/suggest?q=proc&type=metrics
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
accept:
|
9
|
+
-
|
10
|
+
connection:
|
11
|
+
- keep-alive
|
12
|
+
keep-alive:
|
13
|
+
- 30
|
14
|
+
response: !ruby/struct:VCR::Response
|
15
|
+
status: !ruby/struct:VCR::ResponseStatus
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
content-type:
|
20
|
+
- application/json
|
21
|
+
content-length:
|
22
|
+
- "175"
|
23
|
+
body: "[\"proc.net.bytes\",\"proc.net.dropped\",\"proc.net.errs\",\"proc.net.packets\",\"proc.net.tcp\",\"proc.stat.cpu\",\"proc.stat.ctxt\",\"proc.stat.intr\",\"proc.uptime.now\",\"proc.uptime.total\"]"
|
24
|
+
http_version: "1.1"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: http://10.3.172.58:4242/version?json
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
accept:
|
9
|
+
-
|
10
|
+
connection:
|
11
|
+
- keep-alive
|
12
|
+
keep-alive:
|
13
|
+
- 30
|
14
|
+
response: !ruby/struct:VCR::Response
|
15
|
+
status: !ruby/struct:VCR::ResponseStatus
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
content-type:
|
20
|
+
- application/json
|
21
|
+
content-length:
|
22
|
+
- "189"
|
23
|
+
body: "{\"short_revision\":\"33dff14\",\"full_revision\":\"33dff14fe2b910b220f90908b0fd3a7fec71d672\",\"timestamp\":1305036821,\"repo_status\":\"MINT\",\"user\":\"root\",\"host\":\"i-00000106\",\"repo\":\"/root/opentsdb\"}"
|
24
|
+
http_version: "1.1"
|
data/test/test_client.rb
ADDED
@@ -0,0 +1,155 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
describe Continuum::Client do
|
4
|
+
before do
|
5
|
+
@client = Continuum::Client.new '10.3.172.58', '4242'
|
6
|
+
end
|
7
|
+
|
8
|
+
describe :aggregators do
|
9
|
+
before do
|
10
|
+
VCR.use_cassette 'aggregators' do
|
11
|
+
@aggregators = @client.aggregators
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'returns all the aggregators' do
|
16
|
+
assert_equal ["min","sum","max","avg"], @aggregators
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe :logs do
|
21
|
+
before do
|
22
|
+
VCR.use_cassette 'logs' do
|
23
|
+
@logs = @client.logs
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'returns an array of logs' do
|
28
|
+
assert 1024, @logs.length
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'has an approprate log message' do
|
32
|
+
assert_match /New I\/O server boss #1/, @logs.first
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe :query do
|
37
|
+
describe :json do
|
38
|
+
before do
|
39
|
+
VCR.use_cassette 'query_json' do
|
40
|
+
@data = @client.query(
|
41
|
+
:start => '2h-ago',
|
42
|
+
:m => ['sum:rate:proc.net.bytes', 'sum:rate:proc.stat.cpu']
|
43
|
+
)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'should return metadata points' do
|
48
|
+
expected = {"plotted"=>611, "points"=>1719, "etags"=>[["direction"], ["type"]], "timing"=>294}
|
49
|
+
assert_equal expected, @data
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
describe :ascii do
|
54
|
+
before do
|
55
|
+
VCR.use_cassette 'query_ascii' do
|
56
|
+
@data = @client.query(
|
57
|
+
:format => 'ascii',
|
58
|
+
:start => Time.new(2011,5,12,9,44,29),
|
59
|
+
:m => ['sum:rate:proc.net.bytes', 'sum:rate:proc.stat.cpu']
|
60
|
+
)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'should return data points' do
|
65
|
+
lines = @data.split("\n")
|
66
|
+
assert_equal 'proc.net.bytes 1305211753 563002.2 iface=eth0 host=i-00000106', lines.first
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
describe :png do
|
71
|
+
before do
|
72
|
+
VCR.use_cassette 'query_png' do
|
73
|
+
@data = @client.query(
|
74
|
+
:format => 'png',
|
75
|
+
:start => Time.new(2011,5,12,9,44,29),
|
76
|
+
:m => ['sum:rate:proc.net.bytes', 'sum:rate:proc.stat.cpu']
|
77
|
+
)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
it 'should return a PNG' do
|
82
|
+
lines = @data.split("\n")
|
83
|
+
assert_equal "\x89PNG\r", lines.first
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
describe :stats do
|
89
|
+
before do
|
90
|
+
VCR.use_cassette 'stats' do
|
91
|
+
@stats = @client.stats
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
it 'should return stats' do
|
96
|
+
assert_equal 43, @stats.length
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
describe :suggest do
|
101
|
+
before do
|
102
|
+
VCR.use_cassette 'suggest' do
|
103
|
+
@suggestions = @client.suggest 'proc', 'metrics'
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
it 'should return suggestions' do
|
108
|
+
assert_equal 10, @suggestions.length
|
109
|
+
end
|
110
|
+
|
111
|
+
it 'should have an appropriate suggestion' do
|
112
|
+
assert_match /^proc/, @suggestions.first
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
describe :version do
|
117
|
+
before do
|
118
|
+
VCR.use_cassette 'version' do
|
119
|
+
@version = @client.version
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
it 'should have a version' do
|
124
|
+
assert_equal 7, @version.length
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
describe :query_params do
|
129
|
+
before do
|
130
|
+
@hash = {
|
131
|
+
:json => true,
|
132
|
+
:start => '2h-ago',
|
133
|
+
:m => ['sum:rate:proc.net.bytes', 'sum:rate:proc.stat.cpu']
|
134
|
+
}
|
135
|
+
end
|
136
|
+
|
137
|
+
it 'should convert to query params when using an array' do
|
138
|
+
assert_equal 'json=true&start=2h-ago&m=sum:rate:proc.net.bytes&m=sum:rate:proc.stat.cpu', @client.query_params(@hash)
|
139
|
+
end
|
140
|
+
|
141
|
+
it 'should be empty' do
|
142
|
+
assert_equal '', @client.query_params({})
|
143
|
+
end
|
144
|
+
|
145
|
+
it 'should accept required parameters' do
|
146
|
+
assert_equal 'json=true&start=2h-ago&m=sum:rate:proc.net.bytes&m=sum:rate:proc.stat.cpu', @client.query_params(@hash, [:start, 'm'])
|
147
|
+
end
|
148
|
+
|
149
|
+
it 'should raise an argument exception if requirements are not met' do
|
150
|
+
assert_raises ArgumentError do
|
151
|
+
@client.query_params(@hash, [:required])
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
Bundler.setup :default, :test
|
2
|
+
|
3
|
+
require "continuum"
|
4
|
+
require "fakeweb"
|
5
|
+
require "minitest/spec"
|
6
|
+
require "nokogiri"
|
7
|
+
require "vcr"
|
8
|
+
|
9
|
+
VCR.config do |c|
|
10
|
+
c.stub_with :fakeweb
|
11
|
+
c.cassette_library_dir = "test/cassettes"
|
12
|
+
c.default_cassette_options = { :record => :none }
|
13
|
+
end
|
14
|
+
|
15
|
+
MiniTest::Unit.autorun
|
metadata
ADDED
@@ -0,0 +1,139 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: continuum
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.1
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Josh Kleinpeter
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-05-17 00:00:00 -05:00
|
14
|
+
default_executable:
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: hugs
|
18
|
+
prerelease: false
|
19
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
|
+
none: false
|
21
|
+
requirements:
|
22
|
+
- - ">="
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: "0"
|
25
|
+
type: :runtime
|
26
|
+
version_requirements: *id001
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
prerelease: false
|
30
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
31
|
+
none: false
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: "0"
|
36
|
+
type: :runtime
|
37
|
+
version_requirements: *id002
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: fakeweb
|
40
|
+
prerelease: false
|
41
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: "0"
|
47
|
+
type: :development
|
48
|
+
version_requirements: *id003
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: vcr
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - "="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: 1.5.0
|
58
|
+
type: :development
|
59
|
+
version_requirements: *id004
|
60
|
+
- !ruby/object:Gem::Dependency
|
61
|
+
name: autotest-standalone
|
62
|
+
prerelease: false
|
63
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: "0"
|
69
|
+
type: :development
|
70
|
+
version_requirements: *id005
|
71
|
+
description: A Ruby gem that interfaces with OpenTSDB.
|
72
|
+
email:
|
73
|
+
- josh@kleinpeter.org
|
74
|
+
executables: []
|
75
|
+
|
76
|
+
extensions: []
|
77
|
+
|
78
|
+
extra_rdoc_files: []
|
79
|
+
|
80
|
+
files:
|
81
|
+
- .gitignore
|
82
|
+
- .rvmrc
|
83
|
+
- Gemfile
|
84
|
+
- Gemfile.lock
|
85
|
+
- README.md
|
86
|
+
- Rakefile
|
87
|
+
- continuum.gemspec
|
88
|
+
- lib/continuum.rb
|
89
|
+
- lib/continuum/client.rb
|
90
|
+
- lib/continuum/version.rb
|
91
|
+
- test/cassettes/aggregators.yml
|
92
|
+
- test/cassettes/logs.yml
|
93
|
+
- test/cassettes/query_ascii.yml
|
94
|
+
- test/cassettes/query_json.yml
|
95
|
+
- test/cassettes/query_png.yml
|
96
|
+
- test/cassettes/stats.yml
|
97
|
+
- test/cassettes/suggest.yml
|
98
|
+
- test/cassettes/version.yml
|
99
|
+
- test/test_client.rb
|
100
|
+
- test/test_helper.rb
|
101
|
+
has_rdoc: true
|
102
|
+
homepage: ""
|
103
|
+
licenses: []
|
104
|
+
|
105
|
+
post_install_message:
|
106
|
+
rdoc_options: []
|
107
|
+
|
108
|
+
require_paths:
|
109
|
+
- lib
|
110
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
111
|
+
none: false
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: "0"
|
116
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
|
+
none: false
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: "0"
|
122
|
+
requirements: []
|
123
|
+
|
124
|
+
rubyforge_project: continuum
|
125
|
+
rubygems_version: 1.5.0
|
126
|
+
signing_key:
|
127
|
+
specification_version: 3
|
128
|
+
summary: A Ruby gem that interfaces with OpenTSDB.
|
129
|
+
test_files:
|
130
|
+
- test/cassettes/aggregators.yml
|
131
|
+
- test/cassettes/logs.yml
|
132
|
+
- test/cassettes/query_ascii.yml
|
133
|
+
- test/cassettes/query_json.yml
|
134
|
+
- test/cassettes/query_png.yml
|
135
|
+
- test/cassettes/stats.yml
|
136
|
+
- test/cassettes/suggest.yml
|
137
|
+
- test/cassettes/version.yml
|
138
|
+
- test/test_client.rb
|
139
|
+
- test/test_helper.rb
|