influxdb-client 1.0.0.pre.112 → 1.0.0.pre.138
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 +4 -4
- data/.circleci/config.yml +21 -2
- data/README.md +13 -4
- data/bin/influxdb-restart.sh +4 -2
- data/lib/influxdb/client/point.rb +1 -1
- data/test/influxdb/point_test.rb +8 -0
- 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: 70a0a4b9753142baaf4ddb431263aca7d303891cb4d6a7cae9d7120414db7637
|
4
|
+
data.tar.gz: 1979ae95977092440e35f3c543455ddd83fb5e2b968d7da757bb687dd7d9e88c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5d2892760769c3da24b33cc7c901dc6767de02ea3bfd61d0445a94d536f069d79ba820553c7cf0494edd9fbb59f8de2b86dd8f744e05559394ea42ca2e9431d
|
7
|
+
data.tar.gz: '06844837ff0a43ff661e87320a3acf2c2557d41ab0fb430a92f2a6ac295f76d53fe7deac9b094263f9848fb257de5f650f274784640dfd0e08804c7e11468a4e'
|
data/.circleci/config.yml
CHANGED
@@ -48,7 +48,8 @@ commands:
|
|
48
48
|
name: Install dependencies
|
49
49
|
command: |
|
50
50
|
gem install bundler
|
51
|
-
bundle
|
51
|
+
bundle config set path 'vendor/bundle'
|
52
|
+
bundle install --jobs=4 --retry=3
|
52
53
|
- run:
|
53
54
|
name: Static code analyze
|
54
55
|
command: |
|
@@ -75,9 +76,18 @@ jobs:
|
|
75
76
|
ruby-image:
|
76
77
|
type: string
|
77
78
|
default: &default-ruby-image "circleci/ruby:2.6-stretch"
|
79
|
+
influxdb-repository:
|
80
|
+
type: string
|
81
|
+
default: "influxdb"
|
82
|
+
influxdb-version:
|
83
|
+
type: string
|
84
|
+
default: "2.0.0-beta"
|
78
85
|
docker:
|
79
86
|
- image: << parameters.ruby-image >>
|
80
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 >>
|
81
91
|
steps:
|
82
92
|
- prepare
|
83
93
|
- test:
|
@@ -112,8 +122,15 @@ workflows:
|
|
112
122
|
version: 2
|
113
123
|
build:
|
114
124
|
jobs:
|
125
|
+
- tests-ruby:
|
126
|
+
name: ruby-2.7
|
127
|
+
ruby-image: "circleci/ruby:2.7-buster"
|
115
128
|
- tests-ruby:
|
116
129
|
name: ruby-2.6
|
130
|
+
- tests-ruby:
|
131
|
+
name: ruby-2.6-nightly
|
132
|
+
influxdb-repository: "influx"
|
133
|
+
influxdb-version: "nightly"
|
117
134
|
- tests-ruby:
|
118
135
|
name: ruby-2.5
|
119
136
|
ruby-image: "circleci/ruby:2.5-stretch"
|
@@ -122,7 +139,9 @@ workflows:
|
|
122
139
|
ruby-image: "circleci/ruby:2.4-stretch"
|
123
140
|
- deploy-preview:
|
124
141
|
requires:
|
142
|
+
- ruby-2.7
|
125
143
|
- ruby-2.6
|
144
|
+
- ruby-2.6-nightly
|
126
145
|
- ruby-2.5
|
127
146
|
- ruby-2.4
|
128
147
|
filters:
|
@@ -138,4 +157,4 @@ workflows:
|
|
138
157
|
only:
|
139
158
|
- master
|
140
159
|
jobs:
|
141
|
-
- tests-ruby
|
160
|
+
- tests-ruby
|
data/README.md
CHANGED
@@ -10,6 +10,7 @@
|
|
10
10
|
This repository contains the reference Ruby client for the InfluxDB 2.0.
|
11
11
|
|
12
12
|
#### Note: This library is for use with InfluxDB 2.x. For connecting to InfluxDB 1.x instances, please use the [influxdb-ruby](https://github.com/influxdata/influxdb-ruby) client.
|
13
|
+
#### Disclaimer: This library is a work in progress and should not be considered production ready yet.
|
13
14
|
|
14
15
|
## Installation
|
15
16
|
|
@@ -49,9 +50,9 @@ client = InfluxDB::Client.new('https://localhost:9999', 'my-token')
|
|
49
50
|
| use_ssl | Turn on/off SSL for HTTP communication | bool | true |
|
50
51
|
|
51
52
|
```ruby
|
52
|
-
client = InfluxDB::Client.new('https://localhost:9999', 'my-token',
|
53
|
-
bucket: 'my-bucket',
|
54
|
-
org: 'my-org',
|
53
|
+
client = InfluxDB::Client.new('https://localhost:9999', 'my-token',
|
54
|
+
bucket: 'my-bucket',
|
55
|
+
org: 'my-org',
|
55
56
|
precision: InfluxDB::WritePrecision::NANOSECOND)
|
56
57
|
```
|
57
58
|
|
@@ -103,7 +104,7 @@ client = InfluxDB::Client.new('https://localhost:9999', 'my-token',
|
|
103
104
|
```
|
104
105
|
|
105
106
|
but there is also possibility to override configuration per write:
|
106
|
-
|
107
|
+
|
107
108
|
```ruby
|
108
109
|
client = InfluxDB::Client.new('https://localhost:9999', 'my-token')
|
109
110
|
|
@@ -138,6 +139,14 @@ write_api = client.create_write_api
|
|
138
139
|
write_api.write(data: ['h2o,location=west value=33i 15', point, hash])
|
139
140
|
```
|
140
141
|
|
142
|
+
## Local tests
|
143
|
+
|
144
|
+
```
|
145
|
+
brew install wget # on a mac, if not yet installed!
|
146
|
+
bin/influxdb-restart.sh
|
147
|
+
rake test
|
148
|
+
```
|
149
|
+
|
141
150
|
## Contributing
|
142
151
|
|
143
152
|
Bug reports and pull requests are welcome on GitHub at https://github.com/bonitoo-io/influxdb-client-ruby.
|
data/bin/influxdb-restart.sh
CHANGED
@@ -26,9 +26,11 @@ set -e
|
|
26
26
|
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="2.0.0-beta"
|
31
|
+
INFLUXDB_V2_REPOSITORY="${INFLUXDB_V2_REPOSITORY:-$DEFAULT_INFLUXDB_V2_REPOSITORY}"
|
30
32
|
INFLUXDB_V2_VERSION="${INFLUXDB_V2_VERSION:-$DEFAULT_INFLUXDB_V2_VERSION}"
|
31
|
-
INFLUXDB_V2_IMAGE=${DOCKER_REGISTRY}
|
33
|
+
INFLUXDB_V2_IMAGE=${DOCKER_REGISTRY}${INFLUXDB_V2_REPOSITORY}:${INFLUXDB_V2_VERSION}
|
32
34
|
|
33
35
|
SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )"
|
34
36
|
|
@@ -117,7 +117,7 @@ module InfluxDB
|
|
117
117
|
line_protocol << measurement
|
118
118
|
|
119
119
|
tags = _escape_tags
|
120
|
-
line_protocol << ",#{tags}"
|
120
|
+
line_protocol << ",#{tags}" unless tags.empty?
|
121
121
|
line_protocol << ' '.freeze if line_protocol[-1] == '\\'
|
122
122
|
|
123
123
|
fields = _escape_fields
|
data/test/influxdb/point_test.rb
CHANGED
@@ -210,4 +210,12 @@ class PointTest < MiniTest::Test
|
|
210
210
|
|
211
211
|
assert_nil point.to_line_protocol
|
212
212
|
end
|
213
|
+
|
214
|
+
def test_without_tags
|
215
|
+
point = InfluxDB::Point.new(name: 'h2o')
|
216
|
+
.add_field('level', 2)
|
217
|
+
.time(123, InfluxDB::WritePrecision::NANOSECOND)
|
218
|
+
|
219
|
+
assert_equal 'h2o level=2i 123', point.to_line_protocol
|
220
|
+
end
|
213
221
|
end
|
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.pre.
|
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-
|
11
|
+
date: 2020-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|