influxdb 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/influxdb/client.rb +4 -2
- data/lib/influxdb/version.rb +1 -1
- data/spec/influxdb/client_spec.rb +2 -2
- 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: d2a420cee21fd581baa624089984defee6907a8c
|
4
|
+
data.tar.gz: 5dfb27c78ace10b2a8c9c84bc98bcc49024000f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38af5bb53a3dc79ba014c64d98464d0653ad004f795e89545e1ec8d25fbb501c5001c2bc2c8c59a6cafd30069e8266b2d02ad916f1dafb80e9b3196136727e3a
|
7
|
+
data.tar.gz: 87d24e5dcbe7d02beddaa522759e8897b388a3da15f54fe5646d7affb0397aa492d84430b0514f82c967852b594a03747ae42559b9c7082567e3878cd845415d
|
data/lib/influxdb/client.rb
CHANGED
@@ -151,8 +151,8 @@ module InfluxDB
|
|
151
151
|
post(url, data)
|
152
152
|
end
|
153
153
|
|
154
|
-
def query(query)
|
155
|
-
url = URI.encode full_url("db/#{@database}/series", "q=#{query}")
|
154
|
+
def query(query, time_precision=@time_precision)
|
155
|
+
url = URI.encode full_url("db/#{@database}/series", "q=#{query}&time_precision=#{time_precision}")
|
156
156
|
series = get(url)
|
157
157
|
|
158
158
|
if block_given?
|
@@ -245,6 +245,8 @@ module InfluxDB
|
|
245
245
|
delay = [@max_delay, delay * 2].min
|
246
246
|
retry
|
247
247
|
end
|
248
|
+
ensure
|
249
|
+
http.finish if http.started?
|
248
250
|
end
|
249
251
|
end
|
250
252
|
|
data/lib/influxdb/version.rb
CHANGED
@@ -441,7 +441,7 @@ describe InfluxDB::Client do
|
|
441
441
|
data = [{ :name => "foo", :columns => ["name", "age", "count", "count"], :points => [["shahid", 99, 1, 2],["dix", 50, 3, 4]]}]
|
442
442
|
|
443
443
|
stub_request(:get, "http://influxdb.test:9999/db/database/series").with(
|
444
|
-
:query => { :q => "select * from foo", :u => "username", :p => "password"}
|
444
|
+
:query => { :q => "select * from foo", :u => "username", :p => "password", :time_precision => "s"}
|
445
445
|
).to_return(
|
446
446
|
:body => JSON.generate(data)
|
447
447
|
)
|
@@ -473,7 +473,7 @@ describe InfluxDB::Client do
|
|
473
473
|
data = [{ :name => "orders", :columns => ["id", "line_items"], :points => [[1, line_items.to_json]]}]
|
474
474
|
|
475
475
|
stub_request(:get, "http://influxdb.test:9999/db/database/series").with(
|
476
|
-
:query => { :q => "select * from orders", :u => "username", :p => "password"}
|
476
|
+
:query => { :q => "select * from orders", :u => "username", :p => "password", :time_precision => "s"}
|
477
477
|
).to_return(
|
478
478
|
:body => JSON.generate(data)
|
479
479
|
)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: influxdb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Todd Persen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|