Bug #40151 » influx-version-check-before-close.patch
module.py 2019-06-05 10:12:25.934492808 +0200 | ||
---|---|---|
import errno
|
||
import six
|
||
import time
|
||
from distutils.version import StrictVersion
|
||
from mgr_module import MgrModule
|
||
try:
|
||
import influxdb
|
||
from influxdb import InfluxDBClient
|
||
from influxdb.exceptions import InfluxDBClientError
|
||
from requests.exceptions import RequestException
|
||
... | ... | |
start = time.time()
|
||
client = self.get_influx_client()
|
||
client.write_points(points, time_precision='ms')
|
||
client.close()
|
||
if StrictVersion(influxdb.__version__) >= StrictVersion("5.0.0"):
|
||
client.close()
|
||
runtime = time.time() - start
|
||
self.log.debug('Writing points %d to Influx took %.3f seconds',
|
||
len(points), runtime)
|
||
... | ... | |
replication='1',
|
||
default=True,
|
||
database=self.config['database'])
|
||
client.close()
|
||
if StrictVersion(influxdb.__version__) >= StrictVersion("5.0.0"):
|
||
client.close()
|
||
self.log.debug('Gathering statistics')
|
||
points = self.gather_statistics()
|
- « Previous
- 1
- 2
- Next »