opentsdb-ruby 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +8 -7
- data/lib/opentsdb/query_param.rb +3 -3
- data/lib/opentsdb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0965273870cf1d0e970171c7f3feb80e14de6050
|
|
4
|
+
data.tar.gz: 7bd33e7972ef2a6c1f194fe4d042d2b137835f9d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b35e664047831e9afa4f5d93f0a1a58f868d65eb8b4b5b13b7b1a6bc2fab9e9c6c323cec0b88f87f228546bb954265d446ceeac7d4e44153b5ca7a805a53b280
|
|
7
|
+
data.tar.gz: 2c155b03575e551bae84f72e8a0674857e7427486730a449c2d900de5f8d7db754ebb88e3627ed8aeda68b3b6436d6a0c56d1d29397bd34f057d47b622678e9c
|
data/README.md
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Ruby client for OpenTSDB HTTP Query API.
|
|
4
4
|
|
|
5
|
-
[](https://rubygems.org/gems/opentsdb-ruby) [](https://travis-ci.org/cloudinsight/opentsdb-ruby) [](https://codeclimate.com/github/cloudinsight/opentsdb-ruby)
|
|
5
|
+
[](https://rubygems.org/gems/opentsdb-ruby) [](https://travis-ci.org/cloudinsight/opentsdb-ruby) [](https://codeclimate.com/github/cloudinsight/opentsdb-ruby) [](https://codeclimate.com/github/cloudinsight/opentsdb-ruby/coverage)
|
|
6
|
+
|
|
6
7
|
## Installation
|
|
7
8
|
|
|
8
9
|
Add this line to your application's Gemfile:
|
|
9
10
|
|
|
10
11
|
```ruby
|
|
11
|
-
gem 'opentsdb-ruby'
|
|
12
|
+
gem 'opentsdb-ruby', require 'opentsdb'
|
|
12
13
|
```
|
|
13
14
|
|
|
14
15
|
And then execute:
|
|
@@ -26,11 +27,11 @@ Or install it yourself as:
|
|
|
26
27
|
|
|
27
28
|
```ruby
|
|
28
29
|
#config/initializers/opentsdb.rb
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
#require 'opentsdb'
|
|
31
|
+
Opentsdb.configure do |config|
|
|
32
|
+
config.host = 'localhost' # opentsdb server host default: localhost
|
|
33
|
+
config.port = 4242 # opentsdb server port default: 4242
|
|
34
|
+
end
|
|
34
35
|
```
|
|
35
36
|
|
|
36
37
|
### Usage
|
data/lib/opentsdb/query_param.rb
CHANGED
|
@@ -22,7 +22,7 @@ class QueryParam
|
|
|
22
22
|
{}.tap do |h|
|
|
23
23
|
h[:start] = start_time
|
|
24
24
|
h[:end] = end_time
|
|
25
|
-
h[:queries] = queries
|
|
25
|
+
h[:queries] = [queries]
|
|
26
26
|
end.to_json
|
|
27
27
|
end
|
|
28
28
|
|
|
@@ -43,13 +43,13 @@ class QueryParam
|
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
def queries
|
|
46
|
-
|
|
46
|
+
{}.tap do |qh|
|
|
47
47
|
qh[:aggregator] = aggregator
|
|
48
48
|
qh[:rate] = rate
|
|
49
49
|
qh[:metric] = metric
|
|
50
50
|
qh[:tags] = tags
|
|
51
51
|
qh[:downsample] = downsample if downsample
|
|
52
|
-
end
|
|
52
|
+
end
|
|
53
53
|
end
|
|
54
54
|
|
|
55
55
|
def aggregator_for
|
data/lib/opentsdb/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: opentsdb-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- lizhe
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2016-05-
|
|
12
|
+
date: 2016-05-24 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rake
|