influxdb 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9ed83d11d5fa7d16964912a9d586796f26bd785c
4
- data.tar.gz: 4a30560d5455f23971e4d86afb87ea0d2918049b
3
+ metadata.gz: 21dc84dab9784b7ed05591fdb8a9da60b04bd7c2
4
+ data.tar.gz: c1c64ca06a1a2a477e2815551bd319438da95b42
5
5
  SHA512:
6
- metadata.gz: f3a132de196624683b6cf3a2ecc02ec9e0f6ba2fd013432f72ca5d87c2b8e8e827250260414df002507cb554e6acca4181a05b6be6d40d4f0c36add80ffb60d7
7
- data.tar.gz: 9265b98d24c2a5ebfbd1569eaf25d926285c9a45f70b1ffc480156eac612b10b59cb3277c269c8a26eac4963bd00213570d5272aa546eef979fbc3ab0c3d9186
6
+ metadata.gz: 8c4d7f8e1521a5d98aa70a6697573bff443823c6d7ff9841ec521ac4fca6eb2a50afacb3b161be7be78b48947861ad243835249c96e83abe65dd081fbc19aa8c
7
+ data.tar.gz: 2ca93da0da83248bb783236647011eff99565217fab015e7dd779b19bd936778b0ca6dd62d9fb6f40e05742e9d60a7baef7665cd3cfef726ec022405722dcdc6
@@ -7,9 +7,9 @@ before_install:
7
7
  - gem update bundler --no-doc
8
8
  - smoke/provision.sh
9
9
  rvm:
10
- - 2.2.7
11
- - 2.3.4
12
- - 2.4.1
10
+ - 2.2.8
11
+ - 2.3.5
12
+ - 2.4.2
13
13
  - ruby-head
14
14
  env:
15
15
  - TEST_TASK=spec
@@ -19,23 +19,23 @@ matrix:
19
19
  - rvm: jruby-head
20
20
  - rvm: ruby-head
21
21
  - rvm: jruby-9.1.5.0
22
- - rvm: 2.4.1
22
+ - rvm: 2.4.2
23
23
  env: TEST_TASK=smoke influx_version=nightly channel=nightlies
24
24
  include:
25
- - rvm: 2.4.1
25
+ - rvm: 2.4.2
26
26
  env: TEST_TASK=rubocop
27
27
  - rvm: jruby-9.1.5.0
28
28
  - rvm: jruby-head
29
29
  env: JRUBY_OPTS='--client -J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -J-Xss2m -J-Xmx256M'
30
- - rvm: 2.4.1
30
+ - rvm: 2.4.2
31
31
  env: TEST_TASK=smoke influx_version=1.0.2 pkghash=3e4c349cb57507913d9abda1459bdbed
32
- - rvm: 2.4.1
32
+ - rvm: 2.4.2
33
33
  env: TEST_TASK=smoke influx_version=1.1.0 pkghash=682904c350ecfc2a60ec9c6c08453ef2
34
- - rvm: 2.4.1
34
+ - rvm: 2.4.2
35
35
  env: TEST_TASK=smoke influx_version=1.2.4 pkghash=0545d67217393282188e5d5cdedfdc85
36
- - rvm: 2.4.1
37
- env: TEST_TASK=smoke influx_version=1.3.2 pkghash=27b200344bed9de9df193b62a59d378f
38
- - rvm: 2.4.1
36
+ - rvm: 2.4.2
37
+ env: TEST_TASK=smoke influx_version=1.3.5 pkghash=479c63bbb66561c302aff2d9bf639bf3
38
+ - rvm: 2.4.2
39
39
  env: TEST_TASK=smoke influx_version=nightly channel=nightlies
40
40
  fail_fast: true
41
41
  addons:
@@ -6,6 +6,10 @@ For the full commit log, [see here](https://github.com/influxdata/influxdb-ruby/
6
6
 
7
7
  - None yet.
8
8
 
9
+ ## v0.4.2, released 2017-09-26
10
+
11
+ - Bugfix in `InfluxDB::PointValue`: Properly encode backslashes (#200)
12
+
9
13
  ## v0.4.1, released 2017-08-30
10
14
 
11
15
  - Bugfix in async client: Flush queue before exit (#198, #199 @onlynone)
@@ -1,5 +1,3 @@
1
- # coding: utf-8
2
-
3
1
  lib = File.expand_path('../lib', __FILE__)
4
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
3
  require 'influxdb/version'
@@ -25,7 +25,7 @@ module InfluxDB
25
25
  tag_key: ['='.freeze, ' '.freeze, ','.freeze],
26
26
  tag_value: ['='.freeze, ' '.freeze, ','.freeze],
27
27
  field_key: ['='.freeze, ' '.freeze, ','.freeze, '"'.freeze],
28
- field_value: ['"'.freeze],
28
+ field_value: ["\\".freeze, '"'.freeze],
29
29
  }.freeze
30
30
 
31
31
  private_constant :ESCAPES
@@ -58,7 +58,7 @@ module InfluxDB
58
58
  data = data.is_a?(Array) ? data : [data]
59
59
  payload = generate_payload(data)
60
60
  writer.write(payload, precision, retention_policy, database)
61
- rescue => e
61
+ rescue StandardError => e
62
62
  raise e unless config.discard_write_errors
63
63
 
64
64
  log :error, "Cannot write data: #{e.inspect}"
@@ -1,3 +1,3 @@
1
1
  module InfluxDB # :nodoc:
2
- VERSION = "0.4.1".freeze
2
+ VERSION = "0.4.2".freeze
3
3
  end
@@ -101,8 +101,12 @@ module InfluxDB
101
101
  data = []
102
102
 
103
103
  while data.size < max_post_points && !queue.empty?
104
- p = queue.pop(true) rescue next
105
- data.push p
104
+ begin
105
+ p = queue.pop(true)
106
+ data.push p
107
+ rescue ThreadError
108
+ next
109
+ end
106
110
  end
107
111
 
108
112
  return if data.empty?
@@ -110,7 +114,7 @@ module InfluxDB
110
114
  begin
111
115
  log(:debug) { "Found data in the queue! (#{data.length} points)" }
112
116
  client.write(data.join("\n"), nil)
113
- rescue => e
117
+ rescue StandardError => e
114
118
  log :error, "Cannot write data: #{e.inspect}"
115
119
  end
116
120
 
@@ -1,5 +1,3 @@
1
- # encoding: UTF-8
2
-
3
1
  require "spec_helper"
4
2
 
5
3
  describe InfluxDB::PointValue do
@@ -14,21 +12,30 @@ describe InfluxDB::PointValue do
14
12
  '4= ,"\\4' => '5= ,"\\5',
15
13
  intval: 5,
16
14
  floatval: 7.0,
17
- invalid_encoding: "a b",
18
- non_latin: "Улан-Удэ"
15
+ invalid_encoding: "a\255 b", # issue #171
16
+ non_latin: "Улан-Удэ",
17
+ backslash: "C:\\", # issue #200
19
18
  }
20
19
  }
21
- if RUBY_VERSION > "2.0.0"
22
- # see github.com/influxdata/influxdb-ruby/issues/171 for details
23
- point[:values][:invalid_encoding] = "a\255 b"
24
- end
25
20
  point
26
21
  end
27
22
 
28
23
  it 'should escape correctly' do
29
24
  point = InfluxDB::PointValue.new(data)
30
- expected = %(1=\\ \\,"\\1,2\\=\\ \\,"\\2=3\\=\\ \\,"\\3 ) +
31
- %(4\\=\\ \\,\\"\\4="5= ,\\"\\5",intval=5i,floatval=7.0,invalid_encoding="a b",non_latin="Улан-Удэ")
25
+ series = [
26
+ %(1=\\ \\,"\\1),
27
+ %(2\\=\\ \\,"\\2=3\\=\\ \\,"\\3),
28
+ ]
29
+ fields = [
30
+ %(4\\=\\ \\,\\"\\4="5= ,\\"\\\\5"),
31
+ %(intval=5i),
32
+ %(floatval=7.0),
33
+ %(invalid_encoding="a b"),
34
+ %(non_latin="Улан-Удэ"),
35
+ %(backslash="C:\\\\"),
36
+ ]
37
+
38
+ expected = series.join(",") + " " + fields.join(",")
32
39
  expect(point.dump).to eq(expected)
33
40
  end
34
41
  end
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.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todd Persen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-30 00:00:00.000000000 Z
11
+ date: 2017-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake