influxdb-client 1.10.0.pre.1408 → 1.11.0.pre.1492
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +2 -2
- data/CHANGELOG.md +13 -2
- data/README.md +3 -3
- data/bin/influxdb-restart.sh +1 -1
- data/lib/influxdb2/client/flux_csv_parser.rb +1 -1
- data/lib/influxdb2/client/version.rb +1 -1
- data/test/influxdb/delete_api_integration_test.rb +0 -8
- data/test/influxdb/flux_csv_parser_test.rb +25 -2
- data/test/influxdb/query_api_integration_test.rb +21 -0
- data/test/influxdb/query_api_test.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1236713d44eae0b2c2ae536e01701d2bd18aa5117de56abc9a7b4f66fcbb2be0
|
4
|
+
data.tar.gz: 167624af36d2c8e14f80b453dd530f7c0a91e6d2e0f454082c401e0ab2086678
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bac2f6e4a30be9fc2b98a8ab428e9ff4659f8b1350107cbdf8a73899735353bfba2668c901be2405ae66b8636d314416e56904df7f7cb56399e7c7f052a1b06a
|
7
|
+
data.tar.gz: 656c0752105f1af52295a94d7b6dc95db691948ecbde468382f991b30498cd9189b25745393fcdddf0a6384944e4c0d0bb4cae7a996deafbd7d1cd90a3510a96
|
data/.circleci/config.yml
CHANGED
@@ -78,7 +78,7 @@ jobs:
|
|
78
78
|
default: &default-ruby-image "circleci/ruby:2.6-stretch"
|
79
79
|
influxdb-image:
|
80
80
|
type: string
|
81
|
-
default: &default-influxdb-image "influxdb:
|
81
|
+
default: &default-influxdb-image "influxdb:v2.0.3"
|
82
82
|
docker:
|
83
83
|
- image: << parameters.ruby-image >>
|
84
84
|
- image: &influx-image quay.io/influxdb/<< parameters.influxdb-image >>
|
@@ -124,7 +124,7 @@ workflows:
|
|
124
124
|
name: ruby-2.6
|
125
125
|
- tests-ruby:
|
126
126
|
name: ruby-2.6-nightly
|
127
|
-
influxdb-image: "
|
127
|
+
influxdb-image: "influxdb2:nightly"
|
128
128
|
- tests-ruby:
|
129
129
|
name: ruby-2.5
|
130
130
|
ruby-image: "circleci/ruby:2.5-stretch"
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,18 @@
|
|
1
|
-
## 1.
|
1
|
+
## 1.11.0 [unreleased]
|
2
|
+
|
3
|
+
### CI
|
4
|
+
1. [#63](https://github.com/influxdata/influxdb-client-ruby/pull/63): Updated default docker image to v2.0.3
|
5
|
+
|
6
|
+
## 1.10.0 [2020-12-04]
|
2
7
|
|
3
8
|
### Features
|
4
|
-
|
9
|
+
1. [#59](https://github.com/influxdata/influxdb-client-ruby/pull/59): CSV parser is able to parse export from UI
|
10
|
+
|
11
|
+
### CI
|
12
|
+
1. [#62](https://github.com/influxdata/influxdb-client-ruby/pull/62): Updated default docker image to v2.0.2
|
13
|
+
|
14
|
+
### Bug Fixes
|
15
|
+
1. [#61](https://github.com/influxdata/influxdb-client-ruby/pull/61): Query results has precision with nanosecond, e.g. '1970-01-01T00:00:00.000123456+00:00'
|
5
16
|
|
6
17
|
## 1.9.0 [2020-10-30]
|
7
18
|
|
data/README.md
CHANGED
@@ -23,7 +23,7 @@ The client can be installed manually or with bundler.
|
|
23
23
|
To install the client gem manually:
|
24
24
|
|
25
25
|
```
|
26
|
-
gem install influxdb-client -v 1.
|
26
|
+
gem install influxdb-client -v 1.10.0
|
27
27
|
```
|
28
28
|
|
29
29
|
## Usage
|
@@ -194,7 +194,7 @@ The data could be written as:
|
|
194
194
|
|
195
195
|
1. `String` that is formatted as a InfluxDB's line protocol
|
196
196
|
1. `Hash` with keys: name, tags, fields and time
|
197
|
-
1. [Data Point](https://github.com/influxdata/influxdb-client-ruby/blob/master/lib/
|
197
|
+
1. [Data Point](https://github.com/influxdata/influxdb-client-ruby/blob/master/lib/influxdb2/client/point.rb#L28) structure
|
198
198
|
1. `Array` of above items
|
199
199
|
|
200
200
|
```ruby
|
@@ -274,7 +274,7 @@ Server availability can be checked using the `client.health` method. That is equ
|
|
274
274
|
|
275
275
|
### InfluxDB 1.8 API compatibility
|
276
276
|
|
277
|
-
[InfluxDB 1.8.0 introduced forward compatibility APIs](https://docs.influxdata.com/influxdb/
|
277
|
+
[InfluxDB 1.8.0 introduced forward compatibility APIs](https://docs.influxdata.com/influxdb/v1.8/tools/api/#influxdb-2-0-api-compatibility-endpoints) for InfluxDB 2.0. This allow you to easily move from InfluxDB 1.x to InfluxDB 2.0 Cloud or open source.
|
278
278
|
|
279
279
|
The following forward compatible APIs are available:
|
280
280
|
|
data/bin/influxdb-restart.sh
CHANGED
@@ -27,7 +27,7 @@ DEFAULT_DOCKER_REGISTRY="quay.io/influxdb/"
|
|
27
27
|
DOCKER_REGISTRY="${DOCKER_REGISTRY:-$DEFAULT_DOCKER_REGISTRY}"
|
28
28
|
|
29
29
|
DEFAULT_INFLUXDB_V2_REPOSITORY="influxdb"
|
30
|
-
DEFAULT_INFLUXDB_V2_VERSION="
|
30
|
+
DEFAULT_INFLUXDB_V2_VERSION="v2.0.3"
|
31
31
|
INFLUXDB_V2_REPOSITORY="${INFLUXDB_V2_REPOSITORY:-$DEFAULT_INFLUXDB_V2_REPOSITORY}"
|
32
32
|
INFLUXDB_V2_VERSION="${INFLUXDB_V2_VERSION:-$DEFAULT_INFLUXDB_V2_VERSION}"
|
33
33
|
INFLUXDB_V2_IMAGE=${DOCKER_REGISTRY}${INFLUXDB_V2_REPOSITORY}:${INFLUXDB_V2_VERSION}
|
@@ -56,8 +56,6 @@ class DeleteApiIntegrationTest < MiniTest::Test
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def test_delete
|
59
|
-
# TODO: https://github.com/influxdata/influxdb/issues/19545
|
60
|
-
skip
|
61
59
|
@client.create_delete_api.delete(Time.utc(2015, 10, 16, 8, 20, 15), Time.utc(2020, 10, 16, 8, 20, 15),
|
62
60
|
predicate: 'location="europe"')
|
63
61
|
|
@@ -65,24 +63,18 @@ class DeleteApiIntegrationTest < MiniTest::Test
|
|
65
63
|
end
|
66
64
|
|
67
65
|
def test_delete_without_predicate
|
68
|
-
# TODO: https://github.com/influxdata/influxdb/issues/19545
|
69
|
-
skip
|
70
66
|
@client.create_delete_api.delete(Time.utc(2016, 10, 15, 7, 20, 15), Time.utc(2018, 10, 14, 8, 20, 15))
|
71
67
|
|
72
68
|
assert_equal 2, _query_count
|
73
69
|
end
|
74
70
|
|
75
71
|
def test_delete_all
|
76
|
-
# TODO: https://github.com/influxdata/influxdb/issues/19545
|
77
|
-
skip
|
78
72
|
@client.create_delete_api.delete(Time.utc(2010, 10, 15, 7, 20, 15), Time.utc(2020, 10, 14, 8, 20, 15))
|
79
73
|
|
80
74
|
assert_equal 0, _query_count
|
81
75
|
end
|
82
76
|
|
83
77
|
def test_delete_without_interval
|
84
|
-
# TODO: https://github.com/influxdata/influxdb/issues/19545
|
85
|
-
skip
|
86
78
|
error = assert_raises InfluxDB2::InfluxError do
|
87
79
|
@client.create_delete_api.delete(nil, nil)
|
88
80
|
end
|
@@ -155,10 +155,33 @@ class FluxCsvParserTest < MiniTest::Test
|
|
155
155
|
tables = InfluxDB2::FluxCsvParser.new(data).parse.tables
|
156
156
|
records = tables[0].records
|
157
157
|
|
158
|
-
assert_equal
|
158
|
+
assert_equal _parse_time('1970-01-01T00:00:10Z'), records[0].values['value']
|
159
159
|
assert_nil records[1].values['value']
|
160
160
|
end
|
161
161
|
|
162
|
+
def test_mapping_rfc3339_nano
|
163
|
+
data = "#group,false,false,true,true,false,false,true,true,true,true,true,true\n" \
|
164
|
+
'#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,' \
|
165
|
+
"string,string,string,string,string,string\n" \
|
166
|
+
"#default,mean,,,,,,,,,,,\n" \
|
167
|
+
",result,table,_start,_stop,_time,_value,_field,_measurement,language,license,name,owner\n" \
|
168
|
+
',,0,2020-11-02T07:29:49.55050738Z,2020-12-02T07:29:49.55050738Z,2020-11-02T09:00:00Z,9,' \
|
169
|
+
"stars,github_repository,Ruby,MIT License,influxdb-client-ruby,influxdata\n"
|
170
|
+
|
171
|
+
tables = InfluxDB2::FluxCsvParser.new(data).parse.tables
|
172
|
+
records = tables[0].records
|
173
|
+
|
174
|
+
assert_equal 9, records[0].values['_value']
|
175
|
+
start = Time.parse(records[0].values['_start'])
|
176
|
+
assert_equal 2020, start.year
|
177
|
+
assert_equal 11, start.month
|
178
|
+
assert_equal 2, start.day
|
179
|
+
assert_equal 7, start.hour
|
180
|
+
assert_equal 29, start.min
|
181
|
+
assert_equal 49, start.sec
|
182
|
+
assert_equal '55050738', start.strftime('%8N')
|
183
|
+
end
|
184
|
+
|
162
185
|
def test_mapping_duration
|
163
186
|
data = '#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339' \
|
164
187
|
",dateTime:RFC3339,long,string,string,string,duration\n" \
|
@@ -209,7 +232,7 @@ class FluxCsvParserTest < MiniTest::Test
|
|
209
232
|
private
|
210
233
|
|
211
234
|
def _parse_time(time)
|
212
|
-
Time.parse(time).to_datetime.rfc3339
|
235
|
+
Time.parse(time).to_datetime.rfc3339(9)
|
213
236
|
end
|
214
237
|
|
215
238
|
def _assert_record(flux_record, values: nil, size: 0, value: nil)
|
@@ -55,4 +55,25 @@ class QueryApiIntegrationTest < MiniTest::Test
|
|
55
55
|
assert_equal 2, record.value
|
56
56
|
assert_equal 'level', record.field
|
57
57
|
end
|
58
|
+
|
59
|
+
def test_parsed_time_precision
|
60
|
+
now = Time.now.utc
|
61
|
+
measurement = 'h2o_query_' + now.to_i.to_s + now.nsec.to_s
|
62
|
+
|
63
|
+
@client.create_write_api.write(data: InfluxDB2::Point.new(name: measurement)
|
64
|
+
.add_field('value', 10)
|
65
|
+
.time(123_456, InfluxDB2::WritePrecision::NANOSECOND))
|
66
|
+
|
67
|
+
result = @client.create_query_api.query(query: 'from(bucket: "my-bucket") |> range(start: 0, stop: now()) '\
|
68
|
+
"|> filter(fn: (r) => r._measurement == \"#{measurement}\")")
|
69
|
+
|
70
|
+
assert_equal 1, result.size
|
71
|
+
|
72
|
+
records = result[0].records
|
73
|
+
assert_equal 1, records.size
|
74
|
+
|
75
|
+
record = records[0]
|
76
|
+
assert_equal 10, record.value
|
77
|
+
assert_equal '1970-01-01T00:00:00.000123456+00:00', record.values['_time']
|
78
|
+
end
|
58
79
|
end
|
@@ -67,7 +67,7 @@ class QueryApiTest < MiniTest::Test
|
|
67
67
|
|
68
68
|
record1 = result[0].records[0]
|
69
69
|
|
70
|
-
assert_equal Time.parse('1970-01-01T00:00:10Z').to_datetime.rfc3339, record1.time
|
70
|
+
assert_equal Time.parse('1970-01-01T00:00:10Z').to_datetime.rfc3339(9), record1.time
|
71
71
|
assert_equal 'mem', record1.measurement
|
72
72
|
assert_equal 10, record1.value
|
73
73
|
assert_equal 'free', record1.field
|
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.
|
4
|
+
version: 1.11.0.pre.1492
|
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-
|
11
|
+
date: 2020-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|