mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-28 11:41:46 +03:00
InfluxDB > 0.9.3 needs float and not int for numerical value. Correct issue#749 and issue#750
This commit is contained in:
parent
50a7ca7dee
commit
8a7873ed7e
@ -133,9 +133,15 @@ class Export(GlancesExport):
|
||||
# Manage prefix
|
||||
if self.prefix is not None:
|
||||
name = self.prefix + '.' + name
|
||||
# logger.info(self.prefix)
|
||||
# Create DB input
|
||||
if self.version == INFLUXDB_09:
|
||||
# Convert all int to float (mandatory for InfluxDB>0.9.2)
|
||||
# Correct issue#750 and issue#749
|
||||
for i, v in enumerate(points):
|
||||
try:
|
||||
points[i] = float(points[i])
|
||||
except ValueError:
|
||||
pass
|
||||
data = [{'measurement': name,
|
||||
'tags': self.parse_tags(self.tags),
|
||||
'fields': dict(zip(columns, points))}]
|
||||
|
Loading…
Reference in New Issue
Block a user