Merge "Add configuration option influxdb.batch_size"
This commit is contained in:
commit
14b98a40fd
@ -27,6 +27,9 @@ influxdb_opts = [
|
||||
help='Default retention period in hours for new '
|
||||
'databases automatically created by the persister',
|
||||
default=0),
|
||||
cfg.IntOpt('batch_size',
|
||||
help='Maximum size of the batch to write to the database.',
|
||||
default=10000),
|
||||
cfg.HostAddressOpt('ip_address',
|
||||
help='Valid IP address or hostname '
|
||||
'to InfluxDB instance'),
|
||||
|
@ -52,9 +52,11 @@ class AbstractInfluxdbRepository(abstract_repository.AbstractRepository):
|
||||
# NOTE (brtknr): Loop twice to ensure database is created if missing.
|
||||
for retry in range(2):
|
||||
try:
|
||||
batch_size = self.conf.influxdb.batch_size
|
||||
self._influxdb_client.write_points(data_points, 'ms',
|
||||
protocol='line',
|
||||
database=database)
|
||||
database=database,
|
||||
batch_size=batch_size)
|
||||
break
|
||||
except influxdb.exceptions.InfluxDBClientError as ex:
|
||||
# When a databse is not found, the returned exception resolves
|
||||
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Configuration option `batch_size` for InfluxDB to control the maximum
|
||||
size of batches written to the database. Default value set to 10 000 data
|
||||
points.
|
Loading…
x
Reference in New Issue
Block a user