influxdb 0.1.5 → 0.1.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c946c227feda3c850a07c1bc1bdc4d2342b37a11
4
- data.tar.gz: 92b86b34576b178a14aad7834405a5da9ab497bd
3
+ metadata.gz: d2a420cee21fd581baa624089984defee6907a8c
4
+ data.tar.gz: 5dfb27c78ace10b2a8c9c84bc98bcc49024000f9
5
5
  SHA512:
6
- metadata.gz: 9b41767df9856ec0be8811872a5c7bc54d6e0ed2b632c02401663dfffd708003efcbd9fd2798bbf05fce099907581253ee130cd70dc7ff4c62053300986a75b8
7
- data.tar.gz: 5de1891ac4fae210e4c4b86746cbef3c64e2f4f4a298f474e16655c96969c6ba5f251860cef97f87b15c9e01b5e38ec1b2aa841f84f94202fe7daa927e5a07c4
6
+ metadata.gz: 38af5bb53a3dc79ba014c64d98464d0653ad004f795e89545e1ec8d25fbb501c5001c2bc2c8c59a6cafd30069e8266b2d02ad916f1dafb80e9b3196136727e3a
7
+ data.tar.gz: 87d24e5dcbe7d02beddaa522759e8897b388a3da15f54fe5646d7affb0397aa492d84430b0514f82c967852b594a03747ae42559b9c7082567e3878cd845415d
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module InfluxDB
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -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.5
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-09 00:00:00.000000000 Z
11
+ date: 2014-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json