mirror of https://github.com/nicolargo/glances
Merge pull request #1599 from fcalvet/develop
Specify precision to seconds for influxDB outputpull/1621/head
commit
0cdf91ba53
|
@ -1243,7 +1243,7 @@
|
|||
"measurement": "localhost.diskio",
|
||||
"orderByTime": "ASC",
|
||||
"policy": "default",
|
||||
"query": "SELECT mean(\"$disk.read_bytes\") FROM \"localhost.diskio\" WHERE $timeFilter GROUP BY time($__interval) fill(none)",
|
||||
"query": "SELECT mean(\"$disk.read_bytes\")/mean(\"$disk.time_since_update\") FROM \"localhost.diskio\" WHERE $timeFilter GROUP BY time($__interval) fill(none)",
|
||||
"rawQuery": true,
|
||||
"refId": "A",
|
||||
"resultFormat": "time_series",
|
||||
|
@ -1286,7 +1286,7 @@
|
|||
"measurement": "localhost.diskio",
|
||||
"orderByTime": "ASC",
|
||||
"policy": "default",
|
||||
"query": "SELECT mean(\"$disk.write_bytes\") FROM \"localhost.diskio\" WHERE $timeFilter GROUP BY time($__interval) fill(none)",
|
||||
"query": "SELECT mean(\"$disk.write_bytes\")/mean(\"$disk.time_since_update\") FROM \"localhost.diskio\" WHERE $timeFilter GROUP BY time($__interval) fill(none)",
|
||||
"rawQuery": true,
|
||||
"refId": "B",
|
||||
"resultFormat": "time_series",
|
||||
|
@ -1335,7 +1335,7 @@
|
|||
"show": true
|
||||
},
|
||||
{
|
||||
"format": "short",
|
||||
"format": "bytes",
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
|
@ -3183,4 +3183,4 @@
|
|||
"title": "Glances",
|
||||
"uid": "000000002",
|
||||
"version": 10
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
Elasticsearch
|
||||
=============
|
||||
.. note::
|
||||
You need to install the `elasticsearch`_ library on your system.
|
||||
|
||||
You can export statistics to an ``Elasticsearch`` server. The connection
|
||||
should be defined in the Glances configuration file as following:
|
||||
|
@ -36,3 +38,5 @@ get the CPU system stats:
|
|||
"value": "2.2"
|
||||
}
|
||||
}
|
||||
|
||||
.. _elasticsearch: https://pypi.org/project/elasticsearch/
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
You are in the main Glances source folder. This page is **ONLY** for developers.
|
||||
|
||||
If you are looking for the user manual, please follow this link:
|
||||
https://github.com/nicolargo/glances/blob/master/docs/glances-doc.rst
|
||||
https://glances.readthedocs.io/en/stable/
|
||||
|
||||
===
|
||||
|
||||
|
@ -42,6 +42,7 @@ outputs
|
|||
...
|
||||
exports
|
||||
=> Glances export interfaces
|
||||
glances_export.py "Father class" for exports
|
||||
glances_csv.py The CSV export module
|
||||
glances_influxdb.py The InfluxDB export module
|
||||
glances_mqtt.py The MQTT export module
|
||||
|
@ -49,3 +50,9 @@ exports
|
|||
glances_rabbitmq.py The RabbitMQ export module
|
||||
glances_statsd.py The StatsD export module
|
||||
...
|
||||
amps
|
||||
=> Glances Application Monitoring Processes (AMP)
|
||||
glances_amp.py "Father class" for AMPs
|
||||
glances_default.py Default AMP
|
||||
glances_nginx.py Nginx AMP
|
||||
...
|
||||
|
|
|
@ -130,7 +130,7 @@ class Export(GlancesExport):
|
|||
logger.debug("Cannot export empty {} stats to InfluxDB".format(name))
|
||||
else:
|
||||
try:
|
||||
self.client.write_points(self._normalize(name, columns, points))
|
||||
self.client.write_points(self._normalize(name, columns, points), time_precision="s")
|
||||
except Exception as e:
|
||||
# Log level set to debug instead of error (see: issue #1561)
|
||||
logger.debug("Cannot export {} stats to InfluxDB ({})".format(name, e))
|
||||
|
|
|
@ -292,7 +292,8 @@ def get_device_name(device_handle):
|
|||
def get_mem(device_handle):
|
||||
"""Get GPU device memory consumption in percent."""
|
||||
try:
|
||||
return pynvml.nvmlDeviceGetUtilizationRates(device_handle).memory
|
||||
memory_info = pynvml.nvmlDeviceGetMemoryInfo(device_handle)
|
||||
return memory_info.used * 100.0 / memory_info.total
|
||||
except pynvml.NVMLError:
|
||||
return None
|
||||
|
||||
|
|
Loading…
Reference in New Issue