@@ -192,40 +192,25 @@ from influxdb import SeriesHelper
192
192
193
193
my_client = InfluxDBClient(host = ' 127.0.0.1' , port = 8086 , username = ' root' , password = ' root' , database = ' dbname' )
194
194
195
- class MySeriesHelper (SeriesHelper ):
196
- """ Instantiate SeriesHelper to write points to the backend."""
197
195
196
+ class MySeriesHelper (SeriesHelper ):
198
197
class Meta :
199
- """ Meta class stores time series helper configuration."""
200
-
201
- # The client should be an instance of InfluxDBClient.
202
198
client = my_client
203
-
204
- # The series name must be a string. Add dependent fields/tags
205
- # in curly brackets.
206
199
series_name = ' events.stats.{server_name} '
207
-
208
- # Defines all the fields in this time series.
209
200
fields = [' some_stat' , ' other_stat' ]
210
-
211
- # Defines all the tags for the series.
212
201
tags = [' server_name' ]
213
-
214
- # Defines the number of data points to store prior to writing
215
- # on the wire.
216
202
bulk_size = 5
217
-
218
- # autocommit must be set to True when using bulk_size
219
203
autocommit = True
220
204
205
+
221
206
MySeriesHelper(server_name = ' us.east-1' , some_stat = 159 , other_stat = 10 )
222
207
MySeriesHelper(server_name = ' us.east-1' , some_stat = 158 , other_stat = 20 )
223
208
224
209
MySeriesHelper.commit()
225
210
```
226
211
227
- There ` influxdb-client-python ` doesn't have an equivalent implementation for ` MySeriesHelper ` , but there is an option
228
- to use Python [ Data Classes] ( https://docs.python.org/3/library/dataclasses.html ) way.
212
+ The ` influxdb-client-python ` doesn't have an equivalent implementation for ` MySeriesHelper ` , but there is an option
213
+ to use Python [ Data Classes] ( https://docs.python.org/3/library/dataclasses.html ) way:
229
214
230
215
** influxdb-client-python**
231
216
0 commit comments