summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Hennion <nicolas@nicolargo.com>2020-02-16 11:25:16 +0100
committerGitHub <noreply@github.com>2020-02-16 11:25:16 +0100
commit0cdf91ba53aecd8322134484e73ecd5bb0daa9f0 (patch)
tree976bc46b384a84c533fe80009b8b82b42109283a
parent3e5ec443cea6edfd705622b4c90da2783ff8bc35 (diff)
parent97916d2126eb575d37ad8ed7eccaaa30f9c65f4f (diff)
Merge pull request #1599 from fcalvet/develop
Specify precision to seconds for influxDB output
-rw-r--r--conf/glances-grafana.json8
-rw-r--r--docs/gw/elastic.rst4
-rw-r--r--glances/README.txt9
-rw-r--r--glances/exports/glances_influxdb.py2
-rw-r--r--glances/plugins/glances_gpu.py3
5 files changed, 19 insertions, 7 deletions
diff --git a/conf/glances-grafana.json b/conf/glances-grafana.json
index 0156140f..4d6cda5b 100644
--- a/conf/glances-grafana.json
+++ b/conf/glances-grafana.json
@@ -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
-} \ No newline at end of file
+}
diff --git a/docs/gw/elastic.rst b/docs/gw/elastic.rst
index f0897f02..2c247fa8 100644
--- a/docs/gw/elastic.rst
+++ b/docs/gw/elastic.rst
@@ -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/
diff --git a/glances/README.txt b/glances/README.txt
index f7ba0575..fdfb2f12 100644
--- a/glances/README.txt
+++ b/glances/README.txt
@@ -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
+ ...
diff --git a/glances/exports/glances_influxdb.py b/glances/exports/glances_influxdb.py
index 91cfddf3..5df70832 100644
--- a/glances/exports/glances_influxdb.py
+++ b/glances/exports/glances_influxdb.py
@@ -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))
diff --git a/glances/plugins/glances_gpu.py b/glances/plugins/glances_gpu.py
index cf588216..9fd1c292 100644
--- a/glances/plugins/glances_gpu.py
+++ b/glances/plugins/glances_gpu.py
@@ -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