From c66f874e8dfa68407d74c3e0c8c2e89577e52a34 Mon Sep 17 00:00:00 2001 From: fcalvet <38648518+fcalvet@users.noreply.github.com> Date: Mon, 10 Feb 2020 17:00:34 +0100 Subject: Reduced precision to seconds in influxdb export "To significantly improve compression, use the coarsest precision possible for timestamps." see documentation: https://docs.influxdata.com/influxdb/v1.7/write_protocols/line_protocol_reference/#syntax-description --- glances/exports/glances_influxdb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)) -- cgit v1.2.3 From 84c3549aad855a7d831261df9ab0007c2fe01ff2 Mon Sep 17 00:00:00 2001 From: fcalvet <38648518+fcalvet@users.noreply.github.com> Date: Mon, 10 Feb 2020 17:08:53 +0100 Subject: Slight glances/README.txt update * Updated link to docs * Added export base class * Added AMPs --- glances/README.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 + ... -- cgit v1.2.3 From 3190a9fd70a6fe4473f102c63d39c1a1462ec2b8 Mon Sep 17 00:00:00 2001 From: fcalvet <38648518+fcalvet@users.noreply.github.com> Date: Mon, 10 Feb 2020 17:53:04 +0100 Subject: Update grafana example for diskio Taking into account time_since_update in a similar manner to networks --- conf/glances-grafana.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/glances-grafana.json b/conf/glances-grafana.json index 0156140f..9f5c7c77 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", @@ -3183,4 +3183,4 @@ "title": "Glances", "uid": "000000002", "version": 10 -} \ No newline at end of file +} -- cgit v1.2.3 From f42ff86f64755a0c605ae2172dd53e1e3e34baa8 Mon Sep 17 00:00:00 2001 From: fcalvet <38648518+fcalvet@users.noreply.github.com> Date: Mon, 10 Feb 2020 18:00:37 +0100 Subject: Correcting diskio write units in grafana dashboard --- conf/glances-grafana.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/glances-grafana.json b/conf/glances-grafana.json index 9f5c7c77..4d6cda5b 100644 --- a/conf/glances-grafana.json +++ b/conf/glances-grafana.json @@ -1335,7 +1335,7 @@ "show": true }, { - "format": "short", + "format": "bytes", "logBase": 1, "max": null, "min": null, -- cgit v1.2.3 From b6727ad42e6d315a208902070cb239af884dc96c Mon Sep 17 00:00:00 2001 From: fcalvet <38648518+fcalvet@users.noreply.github.com> Date: Mon, 10 Feb 2020 18:42:25 +0100 Subject: Requirement for elasticsearch library for export --- docs/gw/elastic.rst | 4 ++++ 1 file changed, 4 insertions(+) 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/ -- cgit v1.2.3 From 97916d2126eb575d37ad8ed7eccaaa30f9c65f4f Mon Sep 17 00:00:00 2001 From: fcalvet <38648518+fcalvet@users.noreply.github.com> Date: Tue, 11 Feb 2020 09:11:33 +0100 Subject: fix GPU memory consumption reporting Reverting changes in d434333dfe8f377989537ddad2296215fd6f78b5 which displayed something else than memory usage. Old calculation with new py3nvml module still aligns with nvidia-smi output --- glances/plugins/glances_gpu.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3