influxdb-client 1.0.0.beta → 1.0.0.pre.138

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
  SHA256:
3
- metadata.gz: e203e9d1b0a4b60718bf0dfaaf61b51ecba01a8272d6d87b27961a2ee648e19e
4
- data.tar.gz: 3ca6b8adf3d93095151f49c19707c01825935f7c2715af85e701550493f26c1d
3
+ metadata.gz: 70a0a4b9753142baaf4ddb431263aca7d303891cb4d6a7cae9d7120414db7637
4
+ data.tar.gz: 1979ae95977092440e35f3c543455ddd83fb5e2b968d7da757bb687dd7d9e88c
5
5
  SHA512:
6
- metadata.gz: d35c17008c9cafaa987bc60373fa124ba11bde79e6b92b7f09de611e43e1031831a194d4a626791537d140926a2722a63588de9730592ab86cc7bfd4c7b49658
7
- data.tar.gz: 33ce6e893e185b74d30210ab14494ee759f853678f12579ca982f065b6923091833e45032bf57ad654039416d5ba89c46cd0c6fea21fe3694aece586d75ce56c
6
+ metadata.gz: f5d2892760769c3da24b33cc7c901dc6767de02ea3bfd61d0445a94d536f069d79ba820553c7cf0494edd9fbb59f8de2b86dd8f744e05559394ea42ca2e9431d
7
+ data.tar.gz: '06844837ff0a43ff661e87320a3acf2c2557d41ab0fb430a92f2a6ac295f76d53fe7deac9b094263f9848fb257de5f650f274784640dfd0e08804c7e11468a4e'
@@ -76,12 +76,18 @@ jobs:
76
76
  ruby-image:
77
77
  type: string
78
78
  default: &default-ruby-image "circleci/ruby:2.6-stretch"
79
- influxdb-image:
79
+ influxdb-repository:
80
80
  type: string
81
- default: &default-influxdb-image "influxdb:2.0.0-beta"
81
+ default: "influxdb"
82
+ influxdb-version:
83
+ type: string
84
+ default: "2.0.0-beta"
82
85
  docker:
83
86
  - image: << parameters.ruby-image >>
84
- - image: &influx-image quay.io/influxdb/<< parameters.influxdb-image >>
87
+ - image: &influx-image quay.io/influxdb/influx:nightly
88
+ environment:
89
+ INFLUXDB_V2_REPOSITORY: << parameters.influxdb-repository >>
90
+ INFLUXDB_V2_VERSION: << parameters.influxdb-version >>
85
91
  steps:
86
92
  - prepare
87
93
  - test:
@@ -89,10 +95,6 @@ jobs:
89
95
  - storing-test-results
90
96
 
91
97
  deploy-preview:
92
- parameters:
93
- influxdb-image:
94
- type: string
95
- default: *default-influxdb-image
96
98
  docker:
97
99
  - image: *default-ruby-image
98
100
  - image: *influx-image
@@ -100,7 +102,7 @@ jobs:
100
102
  - run:
101
103
  name: Early return if this build is from a forked repository
102
104
  command: |
103
- if [[ $CIRCLE_PROJECT_USERNAME != "influxdata" ]]; then
105
+ if [[ $CIRCLE_PROJECT_USERNAME != "bonitoo-io" ]]; then
104
106
  echo "Nothing to do for forked repositories, so marking this step successful"
105
107
  circleci step halt
106
108
  fi
@@ -127,7 +129,8 @@ workflows:
127
129
  name: ruby-2.6
128
130
  - tests-ruby:
129
131
  name: ruby-2.6-nightly
130
- influxdb-image: "influx:nightly"
132
+ influxdb-repository: "influx"
133
+ influxdb-version: "nightly"
131
134
  - tests-ruby:
132
135
  name: ruby-2.5
133
136
  ruby-image: "circleci/ruby:2.5-stretch"
@@ -1,3 +1,3 @@
1
1
  mkdir ~/.gem || true
2
2
  echo -e "---\r\n:rubygems_api_key: $GEM_HOST_API_KEY" > ~/.gem/credentials
3
- chmod 0600 ~/.gem/credentials
3
+ chmod 0600 /home/circleci/.gem/credentials
@@ -1,5 +1,5 @@
1
- ## 1.0.0.beta [2020-01-17]
1
+ ## 1.0.0 [unreleased]
2
2
 
3
3
  ### Features
4
- 1. [#4](https://github.com/influxdata/influxdb-client-ruby/pull/4): Added WriteApi that will be used for Fluentd plugin
5
-
4
+ 1. [#4](https://github.com/bonitoo-io/influxdb-client-ruby/pull/4): Added WriteApi that will be used for Fluentd plugin
5
+
data/README.md CHANGED
@@ -1,12 +1,11 @@
1
1
  # influxdb-client-ruby
2
2
 
3
- [![CircleCI](https://circleci.com/gh/influxdata/influxdb-client-ruby.svg?style=svg)](https://circleci.com/gh/influxdata/influxdb-client-ruby)
4
- [![codecov](https://codecov.io/gh/influxdata/influxdb-client-ruby/branch/master/graph/badge.svg)](https://codecov.io/gh/influxdata/influxdb-client-ruby)
3
+ [![CircleCI](https://circleci.com/gh/bonitoo-io/influxdb-client-ruby.svg?style=svg)](https://circleci.com/gh/bonitoo-io/influxdb-client-ruby)
4
+ [![codecov](https://codecov.io/gh/bonitoo-io/influxdb-client-ruby/branch/master/graph/badge.svg)](https://codecov.io/gh/bonitoo-io/influxdb-client-ruby)
5
5
  [![Gem Version](https://badge.fury.io/rb/influxdb-client.svg)](https://badge.fury.io/rb/influxdb-client)
6
- [![License](https://img.shields.io/github/license/influxdata/influxdb-client-ruby.svg)](https://github.com/influxdata/influxdb-client-ruby/blob/master/LICENSE)
7
- [![GitHub issues](https://img.shields.io/github/issues-raw/influxdata/influxdb-client-ruby.svg)](https://github.com/influxdata/influxdb-client-ruby/issues)
8
- [![GitHub pull requests](https://img.shields.io/github/issues-pr-raw/influxdata/influxdb-client-ruby.svg)](https://github.com/influxdata/influxdb-client-ruby/pulls)
9
- [![Slack Status](https://img.shields.io/badge/slack-join_chat-white.svg?logo=slack&style=social)](https://www.influxdata.com/slack)
6
+ [![License](https://img.shields.io/github/license/bonitoo-io/influxdb-client-ruby.svg)](https://github.com/bonitoo-io/influxdb-client-ruby/blob/master/LICENSE)
7
+ [![GitHub issues](https://img.shields.io/github/issues-raw/bonitoo-io/influxdb-client-ruby.svg)](https://github.com/bonitoo-io/influxdb-client-ruby/issues)
8
+ [![GitHub pull requests](https://img.shields.io/github/issues-pr-raw/bonitoo-io/influxdb-client-ruby.svg)](https://github.com/bonitoo-io/influxdb-client-ruby/pulls)
10
9
 
11
10
  This repository contains the reference Ruby client for the InfluxDB 2.0.
12
11
 
@@ -24,7 +23,7 @@ The client can be installed manually or with bundler.
24
23
  To install the client gem manually:
25
24
 
26
25
  ```
27
- gem install influxdb-client -v 1.0.0.beta
26
+ gem install influxdb-client --pre
28
27
  ```
29
28
 
30
29
  ## Usage
@@ -34,7 +33,7 @@ gem install influxdb-client -v 1.0.0.beta
34
33
  Use **InfluxDB::Client** to create a client connected to a running InfluxDB 2 instance.
35
34
 
36
35
  ```ruby
37
- client = InfluxDB2::Client.new('https://localhost:9999', 'my-token')
36
+ client = InfluxDB::Client.new('https://localhost:9999', 'my-token')
38
37
  ```
39
38
 
40
39
  #### Client Options
@@ -51,19 +50,19 @@ client = InfluxDB2::Client.new('https://localhost:9999', 'my-token')
51
50
  | use_ssl | Turn on/off SSL for HTTP communication | bool | true |
52
51
 
53
52
  ```ruby
54
- client = InfluxDB2::Client.new('https://localhost:9999', 'my-token',
53
+ client = InfluxDB::Client.new('https://localhost:9999', 'my-token',
55
54
  bucket: 'my-bucket',
56
55
  org: 'my-org',
57
- precision: InfluxDB2::WritePrecision::NANOSECOND)
56
+ precision: InfluxDB::WritePrecision::NANOSECOND)
58
57
  ```
59
58
 
60
59
  ### Writing data
61
60
 
62
61
  ```ruby
63
- client = InfluxDB2::Client.new('https://localhost:9999', 'my-token',
62
+ client = InfluxDB::Client.new('https://localhost:9999', 'my-token',
64
63
  bucket: 'my-bucket',
65
64
  org: 'my-org',
66
- precision: InfluxDB2::WritePrecision::NANOSECOND)
65
+ precision: InfluxDB::WritePrecision::NANOSECOND)
67
66
 
68
67
  write_api = client.create_write_api
69
68
  write_api.write(data: 'h2o,location=west value=33i 15')
@@ -73,20 +72,20 @@ write_api.write(data: 'h2o,location=west value=33i 15')
73
72
 
74
73
  Configure default time precision:
75
74
  ```ruby
76
- client = InfluxDB2::Client.new('https://localhost:9999', 'my-token',
75
+ client = InfluxDB::Client.new('https://localhost:9999', 'my-token',
77
76
  bucket: 'my-bucket',
78
77
  org: 'my-org',
79
- precision: InfluxDB2::WritePrecision::NANOSECOND)
78
+ precision: InfluxDB::WritePrecision::NANOSECOND)
80
79
  ```
81
80
 
82
81
  Configure precision per write:
83
82
  ```ruby
84
- client = InfluxDB2::Client.new('https://localhost:9999', 'my-token',
83
+ client = InfluxDB::Client.new('https://localhost:9999', 'my-token',
85
84
  bucket: 'my-bucket',
86
85
  org: 'my-org')
87
86
 
88
87
  write_api = client.create_write_api
89
- write_api.write(data: 'h2o,location=west value=33i 15', precision: InfluxDB2::WritePrecision::SECOND)
88
+ write_api.write(data: 'h2o,location=west value=33i 15', precision: InfluxDB::WritePrecision::SECOND)
90
89
  ```
91
90
 
92
91
  Allowed values for precision are:
@@ -99,7 +98,7 @@ Allowed values for precision are:
99
98
 
100
99
  Default `bucket` and `organization` destination are configured via `InfluxDB::Client`:
101
100
  ```ruby
102
- client = InfluxDB2::Client.new('https://localhost:9999', 'my-token',
101
+ client = InfluxDB::Client.new('https://localhost:9999', 'my-token',
103
102
  bucket: 'my-bucket',
104
103
  org: 'my-org')
105
104
  ```
@@ -107,7 +106,7 @@ client = InfluxDB2::Client.new('https://localhost:9999', 'my-token',
107
106
  but there is also possibility to override configuration per write:
108
107
 
109
108
  ```ruby
110
- client = InfluxDB2::Client.new('https://localhost:9999', 'my-token')
109
+ client = InfluxDB::Client.new('https://localhost:9999', 'my-token')
111
110
 
112
111
  write_api = client.create_write_api
113
112
  write_api.write(data: 'h2o,location=west value=33i 15', bucket: 'production-data', org: 'customer-1')
@@ -119,16 +118,16 @@ The data could be written as:
119
118
 
120
119
  1. `String` that is formatted as a InfluxDB's line protocol
121
120
  1. `Hash` with keys: name, tags, fields and time
122
- 1. [Data Point](https://github.com/influxdata/influxdb-client-ruby/blob/master/lib/influxdb/client/point.rb#L28) structure
121
+ 1. [Data Point](https://github.com/bonitoo-io/influxdb-client-ruby/blob/master/lib/influxdb/client/point.rb#L28) structure
123
122
  1. `Array` of above items
124
123
 
125
124
  ```ruby
126
- client = InfluxDB2::Client.new('https://localhost:9999', 'my-token',
125
+ client = InfluxDB::Client.new('https://localhost:9999', 'my-token',
127
126
  bucket: 'my-bucket',
128
127
  org: 'my-org',
129
- precision: InfluxDB2::WritePrecision::NANOSECOND)
128
+ precision: InfluxDB::WritePrecision::NANOSECOND)
130
129
 
131
- point = InfluxDB2::Point.new(name: 'h2o')
130
+ point = InfluxDB::Point.new(name: 'h2o')
132
131
  .add_tag('location', 'europe')
133
132
  .add_field('level', 2)
134
133
 
@@ -150,7 +149,7 @@ rake test
150
149
 
151
150
  ## Contributing
152
151
 
153
- Bug reports and pull requests are welcome on GitHub at https://github.com/influxdata/influxdb-client-ruby.
152
+ Bug reports and pull requests are welcome on GitHub at https://github.com/bonitoo-io/influxdb-client-ruby.
154
153
 
155
154
  ## License
156
155
 
@@ -20,22 +20,22 @@
20
20
 
21
21
  lib = File.expand_path('lib', __dir__)
22
22
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
23
- require 'influxdb2/client/version'
23
+ require 'influxdb/client/version'
24
24
 
25
25
  Gem::Specification.new do |spec|
26
26
  spec.name = 'influxdb-client'
27
- spec.version = ENV['CIRCLE_BUILD_NUM'] ? "#{InfluxDB2::VERSION}-#{ENV['CIRCLE_BUILD_NUM']}" : InfluxDB2::VERSION
27
+ spec.version = ENV['CIRCLE_BUILD_NUM'] ? "#{InfluxDB::VERSION}-#{ENV['CIRCLE_BUILD_NUM']}" : InfluxDB::VERSION
28
28
  spec.authors = ['Jakub Bednar']
29
29
  spec.email = ['jakub.bednar@gmail.com']
30
30
 
31
31
  spec.summary = 'Ruby library for InfluxDB 2.'
32
32
  spec.description = 'This is the official Ruby library for InfluxDB 2.'
33
- spec.homepage = 'https://github.com/influxdata/influxdb-client-ruby'
33
+ spec.homepage = 'https://github.com/bonitoo-io/influxdb-client-ruby'
34
34
  spec.license = 'MIT'
35
35
 
36
36
  spec.metadata['homepage_uri'] = spec.homepage
37
- spec.metadata['source_code_uri'] = 'https://github.com/influxdata/influxdb-client-ruby'
38
- spec.metadata['changelog_uri'] = 'https://raw.githubusercontent.com/influxdata/influxdb-client-ruby/master/CHANGELOG.md'
37
+ spec.metadata['source_code_uri'] = 'https://github.com/bonitoo-io/influxdb-client-ruby'
38
+ spec.metadata['changelog_uri'] = 'https://raw.githubusercontent.com/bonitoo-io/influxdb-client-ruby/master/CHANGELOG.md'
39
39
 
40
40
  spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
41
41
  spec.test_files = spec.files.grep(%r{^(test|spec|features|smoke)/})
@@ -18,8 +18,8 @@
18
18
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
19
  # THE SOFTWARE.
20
20
 
21
- require 'influxdb2/client/version'
22
- require 'influxdb2/client/client'
23
- require 'influxdb2/client/influx_error'
24
- require 'influxdb2/client/write_api'
25
- require 'influxdb2/client/point'
21
+ require 'influxdb/client/version'
22
+ require 'influxdb/client/client'
23
+ require 'influxdb/client/influx_error'
24
+ require 'influxdb/client/write_api'
25
+ require 'influxdb/client/point'
@@ -17,9 +17,8 @@
17
17
  # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
18
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
19
  # THE SOFTWARE.
20
- require 'net/http'
21
20
 
22
- module InfluxDB2
21
+ module InfluxDB
23
22
  # The client is the entry point to HTTP API defined
24
23
  # in https://github.com/influxdata/influxdb/blob/master/http/swagger.yml.
25
24
  class Client
@@ -1,4 +1,4 @@
1
- module InfluxDB2
1
+ module InfluxDB
2
2
  # InfluxError that is raised during HTTP communication.
3
3
  class InfluxError < StandardError
4
4
  # HTTP status code
@@ -18,7 +18,7 @@
18
18
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
19
  # THE SOFTWARE.
20
20
 
21
- module InfluxDB2
21
+ module InfluxDB
22
22
  DEFAULT_WRITE_PRECISION = WritePrecision::NANOSECOND
23
23
  ESCAPE_KEY_LIST = ['\\'.freeze, ','.freeze, ' '.freeze, '='.freeze].freeze
24
24
  ESCAPE_VALUE_LIST = ['\\'.freeze, '"'.freeze].freeze
@@ -197,13 +197,13 @@ module InfluxDB2
197
197
  nano_seconds = @time.to_i * 1e9
198
198
  nano_seconds += @time.tv_nsec
199
199
  case @precision || DEFAULT_WRITE_PRECISION
200
- when InfluxDB2::WritePrecision::MILLISECOND then
200
+ when InfluxDB::WritePrecision::MILLISECOND then
201
201
  (nano_seconds / 1e6).round
202
- when InfluxDB2::WritePrecision::SECOND then
202
+ when InfluxDB::WritePrecision::SECOND then
203
203
  (nano_seconds / 1e9).round
204
- when InfluxDB2::WritePrecision::MICROSECOND then
204
+ when InfluxDB::WritePrecision::MICROSECOND then
205
205
  (nano_seconds / 1e3).round
206
- when InfluxDB2::WritePrecision::NANOSECOND then
206
+ when InfluxDB::WritePrecision::NANOSECOND then
207
207
  nano_seconds.round
208
208
  end
209
209
  else
@@ -18,6 +18,6 @@
18
18
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
19
  # THE SOFTWARE.
20
20
 
21
- module InfluxDB2
22
- VERSION = '1.0.0.beta'.freeze
21
+ module InfluxDB
22
+ VERSION = '1.0.0'.freeze
23
23
  end
@@ -18,7 +18,7 @@
18
18
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
19
  # THE SOFTWARE.
20
20
 
21
- module InfluxDB2
21
+ module InfluxDB
22
22
  # Precision constants.
23
23
  #
24
24
  class WritePrecision
@@ -147,7 +147,7 @@ module InfluxDB2
147
147
  elsif data.respond_to? :map
148
148
  data.map do |item|
149
149
  _generate_payload(item)
150
- end.reject(&:nil?).join("\n".freeze)
150
+ end.reject(&:nil?).join('\n'.freeze)
151
151
  end
152
152
  end
153
153
  end
@@ -22,49 +22,49 @@ require 'test_helper'
22
22
 
23
23
  class ClientTest < Minitest::Test
24
24
  def test_defined_version_number
25
- refute_nil ::InfluxDB2::VERSION
25
+ refute_nil ::InfluxDB::VERSION
26
26
  end
27
27
 
28
28
  def test_client_new
29
- refute_nil InfluxDB2::Client.new('http://localhost:9999', 'my-token')
29
+ refute_nil InfluxDB::Client.new('http://localhost:9999', 'my-token')
30
30
  end
31
31
 
32
32
  def test_client_hash
33
- client1 = InfluxDB2::Client.new('http://localhost:9999', 'my-token')
34
- client2 = InfluxDB2::Client.new('http://localhost:9999', 'my-token-diff')
33
+ client1 = InfluxDB::Client.new('http://localhost:9999', 'my-token')
34
+ client2 = InfluxDB::Client.new('http://localhost:9999', 'my-token-diff')
35
35
 
36
36
  refute_equal client1.hash, client2.hash
37
37
  assert_equal client1.hash, client1.hash
38
38
  end
39
39
 
40
40
  def test_client_eq
41
- client1 = InfluxDB2::Client.new('http://localhost:9999', 'my-token')
42
- client2 = InfluxDB2::Client.new('http://localhost:9999', 'my-token-diff')
41
+ client1 = InfluxDB::Client.new('http://localhost:9999', 'my-token')
42
+ client2 = InfluxDB::Client.new('http://localhost:9999', 'my-token-diff')
43
43
 
44
44
  refute_equal client1, client2
45
45
  assert_equal client1, client1
46
46
  end
47
47
 
48
48
  def test_client_options
49
- client = InfluxDB2::Client.new('http://localhost:9999', 'my-token')
49
+ client = InfluxDB::Client.new('http://localhost:9999', 'my-token')
50
50
 
51
51
  assert_equal 'http://localhost:9999', client.options[:url]
52
52
  assert_equal 'my-token', client.options[:token]
53
53
  end
54
54
 
55
55
  def test_close
56
- client = InfluxDB2::Client.new('http://localhost:9999', 'my-token')
56
+ client = InfluxDB::Client.new('http://localhost:9999', 'my-token')
57
57
 
58
58
  assert_equal true, client.close!
59
59
  assert_equal true, client.close!
60
60
  end
61
61
 
62
62
  def test_get_write_api
63
- client = InfluxDB2::Client.new('http://localhost:9999', 'my-token')
63
+ client = InfluxDB::Client.new('http://localhost:9999', 'my-token')
64
64
 
65
65
  write_api = client.create_write_api
66
66
 
67
67
  refute_nil write_api
68
- assert_instance_of InfluxDB2::WriteApi, write_api
68
+ assert_instance_of InfluxDB::WriteApi, write_api
69
69
  end
70
70
  end
@@ -22,90 +22,90 @@ require 'test_helper'
22
22
 
23
23
  class PointTest < MiniTest::Test
24
24
  def test_to_line_protocol
25
- point_args = InfluxDB2::Point.new(name: 'h2o',
26
- tags: { host: 'aws', region: 'us' },
27
- fields: { level: 5, saturation: '99%' }, time: 123)
25
+ point_args = InfluxDB::Point.new(name: 'h2o',
26
+ tags: { host: 'aws', region: 'us' },
27
+ fields: { level: 5, saturation: '99%' }, time: 123)
28
28
  assert_equal 'h2o,host=aws,region=us level=5i,saturation="99%" 123', point_args.to_line_protocol
29
29
 
30
- point_hash = InfluxDB2::Point.from_hash(name: 'h2o',
31
- tags: { host: 'aws', region: 'us' },
32
- fields: { level: 5, saturation: '99%' }, time: 123)
30
+ point_hash = InfluxDB::Point.from_hash(name: 'h2o',
31
+ tags: { host: 'aws', region: 'us' },
32
+ fields: { level: 5, saturation: '99%' }, time: 123)
33
33
  assert_equal 'h2o,host=aws,region=us level=5i,saturation="99%" 123', point_hash.to_line_protocol
34
34
  end
35
35
 
36
36
  def test_measurement_escape
37
- point = InfluxDB2::Point.new(name: 'h2 o', tags: { location: 'europe' }, fields: { level: 2 })
37
+ point = InfluxDB::Point.new(name: 'h2 o', tags: { location: 'europe' }, fields: { level: 2 })
38
38
  assert_equal 'h2\\ o,location=europe level=2i', point.to_line_protocol
39
39
 
40
- point = InfluxDB2::Point.new(name: 'h2,o', tags: { location: 'europe' }, fields: { level: 2 })
40
+ point = InfluxDB::Point.new(name: 'h2,o', tags: { location: 'europe' }, fields: { level: 2 })
41
41
  assert_equal 'h2\\,o,location=europe level=2i', point.to_line_protocol
42
42
  end
43
43
 
44
44
  def test_tag_empty_key
45
- point = InfluxDB2::Point.new(name: 'h2o', fields: { level: 2 }).add_tag('location', 'europe').add_tag('', 'warn')
45
+ point = InfluxDB::Point.new(name: 'h2o', fields: { level: 2 }).add_tag('location', 'europe').add_tag('', 'warn')
46
46
 
47
47
  assert_equal 'h2o,location=europe level=2i', point.to_line_protocol
48
48
  end
49
49
 
50
50
  def test_tag_empty_value
51
- point = InfluxDB2::Point.new(name: 'h2o', fields: { level: 2 }).add_tag('location', 'europe').add_tag('log', '')
51
+ point = InfluxDB::Point.new(name: 'h2o', fields: { level: 2 }).add_tag('location', 'europe').add_tag('log', '')
52
52
 
53
53
  assert_equal 'h2o,location=europe level=2i', point.to_line_protocol
54
54
  end
55
55
 
56
56
  def test_override_tag_and_field
57
- point = InfluxDB2::Point.new(name: 'h2o', fields: { level: '1' })
58
- .add_tag('location', 'europe')
59
- .add_tag('location', 'europe2')
60
- .add_field(:level, 2)
61
- .add_field(:level, 3)
57
+ point = InfluxDB::Point.new(name: 'h2o', fields: { level: '1' })
58
+ .add_tag('location', 'europe')
59
+ .add_tag('location', 'europe2')
60
+ .add_field(:level, 2)
61
+ .add_field(:level, 3)
62
62
 
63
63
  assert_equal 'h2o,location=europe2 level=3i', point.to_line_protocol
64
64
  end
65
65
 
66
66
  def test_field_types
67
- point = InfluxDB2::Point.new(name: 'h2o')
68
- .add_tag('tag_b', 'b')
69
- .add_tag('tag_a', 'a')
70
- .add_field('n1', -2)
71
- .add_field('n2', 10)
72
- .add_field('n3', 1_265_437_718_438_866_624_512)
73
- .add_field('n4', 5.5)
74
- .add_field('bool', true)
75
- .add_field('string', 'string value')
67
+ point = InfluxDB::Point.new(name: 'h2o')
68
+ .add_tag('tag_b', 'b')
69
+ .add_tag('tag_a', 'a')
70
+ .add_field('n1', -2)
71
+ .add_field('n2', 10)
72
+ .add_field('n3', 1_265_437_718_438_866_624_512)
73
+ .add_field('n4', 5.5)
74
+ .add_field('bool', true)
75
+ .add_field('string', 'string value')
76
76
 
77
77
  expected = 'h2o,tag_a=a,tag_b=b bool=true,n1=-2i,n2=10i,n3=1265437718438866624512i,n4=5.5,string="string value"'
78
78
  assert_equal expected, point.to_line_protocol
79
79
  end
80
80
 
81
81
  def test_field_null_value
82
- point = InfluxDB2::Point.new(name: 'h2o')
83
- .add_tag('location', 'europe')
84
- .add_field('level', 2)
85
- .add_field('warning', nil)
82
+ point = InfluxDB::Point.new(name: 'h2o')
83
+ .add_tag('location', 'europe')
84
+ .add_field('level', 2)
85
+ .add_field('warning', nil)
86
86
 
87
87
  assert_equal 'h2o,location=europe level=2i', point.to_line_protocol
88
88
  end
89
89
 
90
90
  def test_field_escape
91
- point = InfluxDB2::Point.new(name: 'h2o')
92
- .add_tag('location', 'europe')
93
- .add_field('level', 'string esc\\ape value')
91
+ point = InfluxDB::Point.new(name: 'h2o')
92
+ .add_tag('location', 'europe')
93
+ .add_field('level', 'string esc\\ape value')
94
94
 
95
95
  assert_equal 'h2o,location=europe level="string esc\\\\ape value"', point.to_line_protocol
96
96
 
97
- point = InfluxDB2::Point.new(name: 'h2o')
98
- .add_tag('location', 'europe')
99
- .add_field('level', 'string esc"ape value')
97
+ point = InfluxDB::Point.new(name: 'h2o')
98
+ .add_tag('location', 'europe')
99
+ .add_field('level', 'string esc"ape value')
100
100
 
101
101
  assert_equal 'h2o,location=europe level="string esc\"ape value"', point.to_line_protocol
102
102
  end
103
103
 
104
104
  def test_time
105
- point = InfluxDB2::Point.new(name: 'h2o')
106
- .add_tag('location', 'europe')
107
- .add_field('level', 2)
108
- .time(123, InfluxDB2::WritePrecision::NANOSECOND)
105
+ point = InfluxDB::Point.new(name: 'h2o')
106
+ .add_tag('location', 'europe')
107
+ .add_field('level', 2)
108
+ .time(123, InfluxDB::WritePrecision::NANOSECOND)
109
109
 
110
110
  assert_equal 'h2o,location=europe level=2i 123', point.to_line_protocol
111
111
  end
@@ -113,31 +113,31 @@ class PointTest < MiniTest::Test
113
113
  def test_time_formatting
114
114
  time = Time.utc(2015, 10, 15, 8, 20, 15)
115
115
 
116
- point = InfluxDB2::Point.new(name: 'h2o')
117
- .add_tag('location', 'europe')
118
- .add_field('level', 2)
119
- .time(time, InfluxDB2::WritePrecision::MILLISECOND)
116
+ point = InfluxDB::Point.new(name: 'h2o')
117
+ .add_tag('location', 'europe')
118
+ .add_field('level', 2)
119
+ .time(time, InfluxDB::WritePrecision::MILLISECOND)
120
120
 
121
121
  assert_equal 'h2o,location=europe level=2i 1444897215000', point.to_line_protocol
122
122
 
123
- point = InfluxDB2::Point.new(name: 'h2o')
124
- .add_tag('location', 'europe')
125
- .add_field('level', 2)
126
- .time(time, InfluxDB2::WritePrecision::SECOND)
123
+ point = InfluxDB::Point.new(name: 'h2o')
124
+ .add_tag('location', 'europe')
125
+ .add_field('level', 2)
126
+ .time(time, InfluxDB::WritePrecision::SECOND)
127
127
 
128
128
  assert_equal 'h2o,location=europe level=2i 1444897215', point.to_line_protocol
129
129
 
130
- point = InfluxDB2::Point.new(name: 'h2o')
131
- .add_tag('location', 'europe')
132
- .add_field('level', 2)
133
- .time(time, InfluxDB2::WritePrecision::MICROSECOND)
130
+ point = InfluxDB::Point.new(name: 'h2o')
131
+ .add_tag('location', 'europe')
132
+ .add_field('level', 2)
133
+ .time(time, InfluxDB::WritePrecision::MICROSECOND)
134
134
 
135
135
  assert_equal 'h2o,location=europe level=2i 1444897215000000', point.to_line_protocol
136
136
 
137
- point = InfluxDB2::Point.new(name: 'h2o')
138
- .add_tag('location', 'europe')
139
- .add_field('level', 2)
140
- .time(time, InfluxDB2::WritePrecision::NANOSECOND)
137
+ point = InfluxDB::Point.new(name: 'h2o')
138
+ .add_tag('location', 'europe')
139
+ .add_field('level', 2)
140
+ .time(time, InfluxDB::WritePrecision::NANOSECOND)
141
141
 
142
142
  assert_equal 'h2o,location=europe level=2i 1444897215000000000', point.to_line_protocol
143
143
  end
@@ -145,76 +145,76 @@ class PointTest < MiniTest::Test
145
145
  def test_time_formatting_default
146
146
  time = Time.utc(2015, 10, 15, 8, 20, 15)
147
147
 
148
- point = InfluxDB2::Point.new(name: 'h2o', time: time)
149
- .add_tag('location', 'europe')
150
- .add_field('level', 2)
148
+ point = InfluxDB::Point.new(name: 'h2o', time: time)
149
+ .add_tag('location', 'europe')
150
+ .add_field('level', 2)
151
151
 
152
152
  assert_equal 'h2o,location=europe level=2i 1444897215000000000', point.to_line_protocol
153
153
 
154
- point = InfluxDB2::Point.new(name: 'h2o')
155
- .add_tag('location', 'europe')
156
- .add_field('level', 2)
157
- .time(time, nil)
154
+ point = InfluxDB::Point.new(name: 'h2o')
155
+ .add_tag('location', 'europe')
156
+ .add_field('level', 2)
157
+ .time(time, nil)
158
158
 
159
159
  assert_equal 'h2o,location=europe level=2i 1444897215000000000', point.to_line_protocol
160
160
  end
161
161
 
162
162
  def test_time_string
163
- point_args = InfluxDB2::Point.new(name: 'h2o',
164
- tags: { host: 'aws', region: 'us' },
165
- fields: { level: 5 }, time: '123')
163
+ point_args = InfluxDB::Point.new(name: 'h2o',
164
+ tags: { host: 'aws', region: 'us' },
165
+ fields: { level: 5 }, time: '123')
166
166
 
167
167
  assert_equal 'h2o,host=aws,region=us level=5i 123', point_args.to_line_protocol
168
168
  end
169
169
 
170
170
  def test_time_float
171
- point_args = InfluxDB2::Point.new(name: 'h2o',
172
- tags: { host: 'aws', region: 'us' },
173
- fields: { level: 5 }, time: 1.444897215e+18)
171
+ point_args = InfluxDB::Point.new(name: 'h2o',
172
+ tags: { host: 'aws', region: 'us' },
173
+ fields: { level: 5 }, time: 1.444897215e+18)
174
174
 
175
175
  assert_equal 'h2o,host=aws,region=us level=5i 1444897215000000000', point_args.to_line_protocol
176
176
 
177
- point_args = InfluxDB2::Point.new(name: 'h2o',
178
- tags: { host: 'aws', region: 'us' },
179
- fields: { level: 5 }, time: 102_030_405_060)
177
+ point_args = InfluxDB::Point.new(name: 'h2o',
178
+ tags: { host: 'aws', region: 'us' },
179
+ fields: { level: 5 }, time: 102_030_405_060)
180
180
 
181
181
  assert_equal 'h2o,host=aws,region=us level=5i 102030405060', point_args.to_line_protocol
182
182
  end
183
183
 
184
184
  def test_utf_8
185
- point = InfluxDB2::Point.new(name: 'h2o')
186
- .add_tag('location', 'Přerov')
187
- .add_field('level', 2)
188
- .time(123, InfluxDB2::WritePrecision::NANOSECOND)
185
+ point = InfluxDB::Point.new(name: 'h2o')
186
+ .add_tag('location', 'Přerov')
187
+ .add_field('level', 2)
188
+ .time(123, InfluxDB::WritePrecision::NANOSECOND)
189
189
 
190
190
  assert_equal 'h2o,location=Přerov level=2i 123', point.to_line_protocol
191
191
  end
192
192
 
193
193
  def test_infinity_values
194
- point = InfluxDB2::Point.new(name: 'h2o')
195
- .add_tag('location', 'europe')
196
- .add_field('infinity_constant', Float::INFINITY)
197
- .add_field('infinity_positive', 1 / 0.0)
198
- .add_field('infinity_negative', -1 / 0.0)
199
- .add_field('level', 2)
194
+ point = InfluxDB::Point.new(name: 'h2o')
195
+ .add_tag('location', 'europe')
196
+ .add_field('infinity_constant', Float::INFINITY)
197
+ .add_field('infinity_positive', 1 / 0.0)
198
+ .add_field('infinity_negative', -1 / 0.0)
199
+ .add_field('level', 2)
200
200
 
201
201
  assert_equal 'h2o,location=europe level=2i', point.to_line_protocol
202
202
  end
203
203
 
204
204
  def test_only_infinity_values
205
- point = InfluxDB2::Point.new(name: 'h2o')
206
- .add_tag('location', 'europe')
207
- .add_field('infinity_constant', Float::INFINITY)
208
- .add_field('infinity_positive', 1 / 0.0)
209
- .add_field('infinity_negative', -1 / 0.0)
205
+ point = InfluxDB::Point.new(name: 'h2o')
206
+ .add_tag('location', 'europe')
207
+ .add_field('infinity_constant', Float::INFINITY)
208
+ .add_field('infinity_positive', 1 / 0.0)
209
+ .add_field('infinity_negative', -1 / 0.0)
210
210
 
211
211
  assert_nil point.to_line_protocol
212
212
  end
213
213
 
214
214
  def test_without_tags
215
- point = InfluxDB2::Point.new(name: 'h2o')
216
- .add_field('level', 2)
217
- .time(123, InfluxDB2::WritePrecision::NANOSECOND)
215
+ point = InfluxDB::Point.new(name: 'h2o')
216
+ .add_field('level', 2)
217
+ .time(123, InfluxDB::WritePrecision::NANOSECOND)
218
218
 
219
219
  assert_equal 'h2o level=2i 123', point.to_line_protocol
220
220
  end
@@ -27,19 +27,19 @@ class WriteApiIntegrationTest < MiniTest::Test
27
27
  end
28
28
 
29
29
  def test_write_into_influx_db
30
- client = InfluxDB2::Client.new('http://localhost:9999', 'my-token',
31
- bucket: 'my-bucket',
32
- org: 'my-org',
33
- precision: InfluxDB2::WritePrecision::NANOSECOND,
34
- use_ssl: false)
30
+ client = InfluxDB::Client.new('http://localhost:9999', 'my-token',
31
+ bucket: 'my-bucket',
32
+ org: 'my-org',
33
+ precision: InfluxDB::WritePrecision::NANOSECOND,
34
+ use_ssl: false)
35
35
 
36
36
  now = Time.now.utc
37
37
 
38
38
  measurement = 'h2o_' + now.to_i.to_s
39
- point = InfluxDB2::Point.new(name: measurement)
40
- .add_tag('location', 'europe')
41
- .add_field('level', 2)
42
- .time(now, InfluxDB2::WritePrecision::NANOSECOND)
39
+ point = InfluxDB::Point.new(name: measurement)
40
+ .add_tag('location', 'europe')
41
+ .add_field('level', 2)
42
+ .time(now, InfluxDB::WritePrecision::NANOSECOND)
43
43
 
44
44
  client.create_write_api.write(data: point)
45
45
 
@@ -26,7 +26,7 @@ class WriteApiTest < MiniTest::Test
26
26
  end
27
27
 
28
28
  def test_required_arguments
29
- client = InfluxDB2::Client.new('http://localhost:9999', 'my-token')
29
+ client = InfluxDB::Client.new('http://localhost:9999', 'my-token')
30
30
  write_api = client.create_write_api
31
31
 
32
32
  # precision
@@ -35,19 +35,19 @@ class WriteApiTest < MiniTest::Test
35
35
  end
36
36
  # bucket
37
37
  assert_raises ArgumentError do
38
- write_api.write(data: {}, org: 'my-org', precision: InfluxDB2::WritePrecision::NANOSECOND)
38
+ write_api.write(data: {}, org: 'my-org', precision: InfluxDB::WritePrecision::NANOSECOND)
39
39
  end
40
40
  # org
41
41
  assert_raises ArgumentError do
42
- write_api.write(data: {}, bucket: 'my-bucket', precision: InfluxDB2::WritePrecision::NANOSECOND)
42
+ write_api.write(data: {}, bucket: 'my-bucket', precision: InfluxDB::WritePrecision::NANOSECOND)
43
43
  end
44
44
  end
45
45
 
46
46
  def test_default_arguments_
47
- client = InfluxDB2::Client.new('http://localhost:9999', 'my-token',
48
- bucket: 'my-bucket',
49
- org: 'my-org',
50
- precision: InfluxDB2::WritePrecision::NANOSECOND)
47
+ client = InfluxDB::Client.new('http://localhost:9999', 'my-token',
48
+ bucket: 'my-bucket',
49
+ org: 'my-org',
50
+ precision: InfluxDB::WritePrecision::NANOSECOND)
51
51
  write_api = client.create_write_api
52
52
 
53
53
  # without argument errors
@@ -57,11 +57,11 @@ class WriteApiTest < MiniTest::Test
57
57
  def test_write_line_protocol
58
58
  stub_request(:any, 'http://localhost:9999/api/v2/write?bucket=my-bucket&org=my-org&precision=ns')
59
59
  .to_return(status: 204)
60
- client = InfluxDB2::Client.new('http://localhost:9999', 'my-token',
61
- bucket: 'my-bucket',
62
- org: 'my-org',
63
- precision: InfluxDB2::WritePrecision::NANOSECOND,
64
- use_ssl: false)
60
+ client = InfluxDB::Client.new('http://localhost:9999', 'my-token',
61
+ bucket: 'my-bucket',
62
+ org: 'my-org',
63
+ precision: InfluxDB::WritePrecision::NANOSECOND,
64
+ use_ssl: false)
65
65
 
66
66
  client.create_write_api.write(data: 'h2o,location=west value=33i 15')
67
67
 
@@ -72,13 +72,13 @@ class WriteApiTest < MiniTest::Test
72
72
  def test_write_point
73
73
  stub_request(:any, 'http://localhost:9999/api/v2/write?bucket=my-bucket&org=my-org&precision=ns')
74
74
  .to_return(status: 204)
75
- client = InfluxDB2::Client.new('http://localhost:9999', 'my-token',
76
- bucket: 'my-bucket',
77
- org: 'my-org',
78
- precision: InfluxDB2::WritePrecision::NANOSECOND,
79
- use_ssl: false)
75
+ client = InfluxDB::Client.new('http://localhost:9999', 'my-token',
76
+ bucket: 'my-bucket',
77
+ org: 'my-org',
78
+ precision: InfluxDB::WritePrecision::NANOSECOND,
79
+ use_ssl: false)
80
80
 
81
- client.create_write_api.write(data: InfluxDB2::Point.new(name: 'h2o')
81
+ client.create_write_api.write(data: InfluxDB::Point.new(name: 'h2o')
82
82
  .add_tag('location', 'europe')
83
83
  .add_field('level', 2))
84
84
 
@@ -89,11 +89,11 @@ class WriteApiTest < MiniTest::Test
89
89
  def test_write_hash
90
90
  stub_request(:any, 'http://localhost:9999/api/v2/write?bucket=my-bucket&org=my-org&precision=ns')
91
91
  .to_return(status: 204)
92
- client = InfluxDB2::Client.new('http://localhost:9999', 'my-token',
93
- bucket: 'my-bucket',
94
- org: 'my-org',
95
- precision: InfluxDB2::WritePrecision::NANOSECOND,
96
- use_ssl: false)
92
+ client = InfluxDB::Client.new('http://localhost:9999', 'my-token',
93
+ bucket: 'my-bucket',
94
+ org: 'my-org',
95
+ precision: InfluxDB::WritePrecision::NANOSECOND,
96
+ use_ssl: false)
97
97
 
98
98
  client.create_write_api.write(data: { name: 'h2o',
99
99
  tags: { host: 'aws', region: 'us' },
@@ -107,15 +107,15 @@ class WriteApiTest < MiniTest::Test
107
107
  def test_write_collection
108
108
  stub_request(:any, 'http://localhost:9999/api/v2/write?bucket=my-bucket&org=my-org&precision=ns')
109
109
  .to_return(status: 204)
110
- client = InfluxDB2::Client.new('http://localhost:9999', 'my-token',
111
- bucket: 'my-bucket',
112
- org: 'my-org',
113
- precision: InfluxDB2::WritePrecision::NANOSECOND,
114
- use_ssl: false)
110
+ client = InfluxDB::Client.new('http://localhost:9999', 'my-token',
111
+ bucket: 'my-bucket',
112
+ org: 'my-org',
113
+ precision: InfluxDB::WritePrecision::NANOSECOND,
114
+ use_ssl: false)
115
115
 
116
- point = InfluxDB2::Point.new(name: 'h2o')
117
- .add_tag('location', 'europe')
118
- .add_field('level', 2)
116
+ point = InfluxDB::Point.new(name: 'h2o')
117
+ .add_tag('location', 'europe')
118
+ .add_field('level', 2)
119
119
 
120
120
  hash = { name: 'h2o',
121
121
  tags: { host: 'aws', region: 'us' },
@@ -123,8 +123,8 @@ class WriteApiTest < MiniTest::Test
123
123
 
124
124
  client.create_write_api.write(data: ['h2o,location=west value=33i 15', nil, '', point, hash])
125
125
 
126
- expected = "h2o,location=west value=33i 15\nh2o,location=europe level=2i"\
127
- "\nh2o,host=aws,region=us level=5i,saturation=\"99%\" 123"
126
+ expected = 'h2o,location=west value=33i 15\nh2o,location=europe level=2i'\
127
+ '\nh2o,host=aws,region=us level=5i,saturation="99%" 123'
128
128
  assert_requested(:post, 'http://localhost:9999/api/v2/write?bucket=my-bucket&org=my-org&precision=ns',
129
129
  times: 1, body: expected)
130
130
  end
@@ -132,11 +132,11 @@ class WriteApiTest < MiniTest::Test
132
132
  def test_authorization_header
133
133
  stub_request(:any, 'http://localhost:9999/api/v2/write?bucket=my-bucket&org=my-org&precision=ns')
134
134
  .to_return(status: 204)
135
- client = InfluxDB2::Client.new('http://localhost:9999', 'my-token',
136
- bucket: 'my-bucket',
137
- org: 'my-org',
138
- precision: InfluxDB2::WritePrecision::NANOSECOND,
139
- use_ssl: false)
135
+ client = InfluxDB::Client.new('http://localhost:9999', 'my-token',
136
+ bucket: 'my-bucket',
137
+ org: 'my-org',
138
+ precision: InfluxDB::WritePrecision::NANOSECOND,
139
+ use_ssl: false)
140
140
 
141
141
  client.create_write_api.write(data: 'h2o,location=west value=33i 15')
142
142
 
@@ -147,10 +147,10 @@ class WriteApiTest < MiniTest::Test
147
147
  def test_without_data
148
148
  stub_request(:any, 'http://localhost:9999/api/v2/write?bucket=my-bucket&org=my-org&precision=ns')
149
149
  .to_return(status: 204)
150
- client = InfluxDB2::Client.new('http://localhost:9999', 'my-token',
151
- bucket: 'my-bucket',
152
- org: 'my-org',
153
- precision: InfluxDB2::WritePrecision::NANOSECOND)
150
+ client = InfluxDB::Client.new('http://localhost:9999', 'my-token',
151
+ bucket: 'my-bucket',
152
+ org: 'my-org',
153
+ precision: InfluxDB::WritePrecision::NANOSECOND)
154
154
 
155
155
  client.create_write_api.write(data: '')
156
156
 
@@ -164,13 +164,13 @@ class WriteApiTest < MiniTest::Test
164
164
  stub_request(:any, 'http://localhost:9999/api/v2/write?bucket=my-bucket&org=my-org&precision=ns')
165
165
  .to_return(status: 400, headers: { 'X-Platform-Error-Code' => 'invalid' }, body: error_body)
166
166
 
167
- client = InfluxDB2::Client.new('http://localhost:9999', 'my-token',
168
- bucket: 'my-bucket',
169
- org: 'my-org',
170
- precision: InfluxDB2::WritePrecision::NANOSECOND,
171
- use_ssl: false)
167
+ client = InfluxDB::Client.new('http://localhost:9999', 'my-token',
168
+ bucket: 'my-bucket',
169
+ org: 'my-org',
170
+ precision: InfluxDB::WritePrecision::NANOSECOND,
171
+ use_ssl: false)
172
172
 
173
- error = assert_raises InfluxDB2::InfluxError do
173
+ error = assert_raises InfluxDB::InfluxError do
174
174
  client.create_write_api.write(data: 'h2o,location=west value=33i 15')
175
175
  end
176
176
 
@@ -187,11 +187,11 @@ class WriteApiTest < MiniTest::Test
187
187
  stub_request(:any, 'http://localhost:9090/api/v2/write?bucket=my-bucket&org=my-org&precision=ns')
188
188
  .to_return(status: 204)
189
189
 
190
- client = InfluxDB2::Client.new('http://localhost:9999', 'my-token',
191
- bucket: 'my-bucket',
192
- org: 'my-org',
193
- precision: InfluxDB2::WritePrecision::NANOSECOND,
194
- use_ssl: false)
190
+ client = InfluxDB::Client.new('http://localhost:9999', 'my-token',
191
+ bucket: 'my-bucket',
192
+ org: 'my-org',
193
+ precision: InfluxDB::WritePrecision::NANOSECOND,
194
+ use_ssl: false)
195
195
 
196
196
  client.create_write_api.write(data: 'h2o,location=west value=33i 15')
197
197
 
@@ -206,14 +206,14 @@ class WriteApiTest < MiniTest::Test
206
206
  .to_return(status: 307, headers:
207
207
  { 'location' => 'http://localhost:9999/api/v2/write?bucket=my-bucket&org=my-org&precision=ns' })
208
208
 
209
- client = InfluxDB2::Client.new('http://localhost:9999', 'my-token',
210
- bucket: 'my-bucket',
211
- org: 'my-org',
212
- precision: InfluxDB2::WritePrecision::NANOSECOND,
213
- max_redirect_count: 5,
214
- use_ssl: false)
209
+ client = InfluxDB::Client.new('http://localhost:9999', 'my-token',
210
+ bucket: 'my-bucket',
211
+ org: 'my-org',
212
+ precision: InfluxDB::WritePrecision::NANOSECOND,
213
+ max_redirect_count: 5,
214
+ use_ssl: false)
215
215
 
216
- error = assert_raises InfluxDB2::InfluxError do
216
+ error = assert_raises InfluxDB::InfluxError do
217
217
  client.create_write_api.write(data: 'h2o,location=west value=33i 15')
218
218
  end
219
219
 
@@ -221,13 +221,13 @@ class WriteApiTest < MiniTest::Test
221
221
  end
222
222
 
223
223
  def test_write_precision_constant
224
- assert_equal InfluxDB2::WritePrecision::SECOND, InfluxDB2::WritePrecision.new.get_from_value('s')
225
- assert_equal InfluxDB2::WritePrecision::MILLISECOND, InfluxDB2::WritePrecision.new.get_from_value('ms')
226
- assert_equal InfluxDB2::WritePrecision::MICROSECOND, InfluxDB2::WritePrecision.new.get_from_value('us')
227
- assert_equal InfluxDB2::WritePrecision::NANOSECOND, InfluxDB2::WritePrecision.new.get_from_value('ns')
224
+ assert_equal InfluxDB::WritePrecision::SECOND, InfluxDB::WritePrecision.new.get_from_value('s')
225
+ assert_equal InfluxDB::WritePrecision::MILLISECOND, InfluxDB::WritePrecision.new.get_from_value('ms')
226
+ assert_equal InfluxDB::WritePrecision::MICROSECOND, InfluxDB::WritePrecision.new.get_from_value('us')
227
+ assert_equal InfluxDB::WritePrecision::NANOSECOND, InfluxDB::WritePrecision.new.get_from_value('ns')
228
228
 
229
229
  error = assert_raises RuntimeError do
230
- InfluxDB2::WritePrecision.new.get_from_value('not_supported')
230
+ InfluxDB::WritePrecision.new.get_from_value('not_supported')
231
231
  end
232
232
 
233
233
  assert_equal 'The time precision not_supported is not supported.', error.message
@@ -27,7 +27,7 @@ if ENV['CI'] == 'true'
27
27
  end
28
28
 
29
29
  $LOAD_PATH.unshift File.expand_path('../lib', __dir__)
30
- require 'influxdb2/client'
30
+ require 'influxdb/client'
31
31
 
32
32
  require 'minitest/autorun'
33
33
  require 'minitest/reporters'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: influxdb-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta
4
+ version: 1.0.0.pre.138
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakub Bednar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-17 00:00:00.000000000 Z
11
+ date: 2020-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -142,24 +142,24 @@ files:
142
142
  - bin/influxdb-onboarding.sh
143
143
  - bin/influxdb-restart.sh
144
144
  - influxdb-client.gemspec
145
- - lib/influxdb2/client.rb
146
- - lib/influxdb2/client/client.rb
147
- - lib/influxdb2/client/influx_error.rb
148
- - lib/influxdb2/client/point.rb
149
- - lib/influxdb2/client/version.rb
150
- - lib/influxdb2/client/write_api.rb
145
+ - lib/influxdb/client.rb
146
+ - lib/influxdb/client/client.rb
147
+ - lib/influxdb/client/influx_error.rb
148
+ - lib/influxdb/client/point.rb
149
+ - lib/influxdb/client/version.rb
150
+ - lib/influxdb/client/write_api.rb
151
151
  - test/influxdb/client_test.rb
152
152
  - test/influxdb/point_test.rb
153
153
  - test/influxdb/write_api_integration_test.rb
154
154
  - test/influxdb/write_api_test.rb
155
155
  - test/test_helper.rb
156
- homepage: https://github.com/influxdata/influxdb-client-ruby
156
+ homepage: https://github.com/bonitoo-io/influxdb-client-ruby
157
157
  licenses:
158
158
  - MIT
159
159
  metadata:
160
- homepage_uri: https://github.com/influxdata/influxdb-client-ruby
161
- source_code_uri: https://github.com/influxdata/influxdb-client-ruby
162
- changelog_uri: https://raw.githubusercontent.com/influxdata/influxdb-client-ruby/master/CHANGELOG.md
160
+ homepage_uri: https://github.com/bonitoo-io/influxdb-client-ruby
161
+ source_code_uri: https://github.com/bonitoo-io/influxdb-client-ruby
162
+ changelog_uri: https://raw.githubusercontent.com/bonitoo-io/influxdb-client-ruby/master/CHANGELOG.md
163
163
  post_install_message:
164
164
  rdoc_options: []
165
165
  require_paths: