summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicolargo <nicolashennion@gmail.com>2024-05-07 11:49:55 +0200
committernicolargo <nicolashennion@gmail.com>2024-05-07 11:49:55 +0200
commite8563a0fc4b0c0663f354deb0b846421f94a9f95 (patch)
tree1f6c2efc53599b91a41449554d2693483a56263b
parent6e95892e417726198530c3ecb126b197fdfd1a6a (diff)
Format code and update docs/webui
-rw-r--r--Makefile4
-rw-r--r--docs/api.rst244
-rw-r--r--docs/man/glances.12
-rw-r--r--glances/actions.py1
-rw-r--r--glances/amps_list.py1
-rw-r--r--glances/autodiscover.py4
-rw-r--r--glances/client.py2
-rw-r--r--glances/client_browser.py1
-rw-r--r--glances/config.py1
-rw-r--r--glances/cpu_percent.py1
-rw-r--r--glances/event.py12
-rw-r--r--glances/events_list.py48
-rw-r--r--glances/exports/export.py1
-rw-r--r--glances/exports/glances_cassandra/__init__.py1
-rw-r--r--glances/exports/glances_couchdb/__init__.py1
-rw-r--r--glances/exports/glances_csv/__init__.py3
-rw-r--r--glances/exports/glances_elasticsearch/__init__.py1
-rw-r--r--glances/exports/glances_graph/__init__.py1
-rw-r--r--glances/exports/glances_graphite/__init__.py1
-rw-r--r--glances/exports/glances_json/__init__.py1
-rw-r--r--glances/exports/glances_kafka/__init__.py1
-rw-r--r--glances/exports/glances_mongodb/__init__.py1
-rwxr-xr-xglances/exports/glances_mqtt/__init__.py13
-rw-r--r--glances/exports/glances_opentsdb/__init__.py1
-rw-r--r--glances/exports/glances_prometheus/__init__.py1
-rw-r--r--glances/exports/glances_rabbitmq/__init__.py1
-rw-r--r--glances/exports/glances_restful/__init__.py1
-rw-r--r--glances/exports/glances_riemann/__init__.py1
-rw-r--r--glances/exports/glances_statsd/__init__.py1
-rw-r--r--glances/exports/glances_zeromq/__init__.py1
-rw-r--r--glances/filter.py7
-rw-r--r--glances/folder_list.py1
-rw-r--r--glances/history.py1
-rw-r--r--glances/main.py2
-rw-r--r--glances/outdated.py1
-rw-r--r--glances/outputs/glances_bars.py34
-rw-r--r--glances/outputs/glances_curses.py21
-rw-r--r--glances/outputs/glances_restful_api.py12
-rw-r--r--glances/outputs/glances_sparklines.py12
-rw-r--r--glances/outputs/glances_stdout.py6
-rw-r--r--glances/outputs/glances_stdout_apidoc.py65
-rw-r--r--glances/outputs/glances_stdout_csv.py1
-rw-r--r--glances/outputs/glances_stdout_issue.py1
-rw-r--r--glances/outputs/glances_stdout_json.py1
-rw-r--r--glances/password.py1
-rw-r--r--glances/password_list.py1
-rw-r--r--glances/plugins/alert/__init__.py11
-rw-r--r--glances/plugins/amps/__init__.py38
-rw-r--r--glances/plugins/connections/__init__.py2
-rw-r--r--glances/plugins/containers/__init__.py25
-rw-r--r--glances/plugins/containers/engines/docker.py2
-rw-r--r--glances/plugins/cpu/__init__.py22
-rw-r--r--glances/plugins/diskio/__init__.py46
-rw-r--r--glances/plugins/folders/__init__.py8
-rw-r--r--glances/plugins/fs/__init__.py17
-rw-r--r--glances/plugins/gpu/__init__.py6
-rw-r--r--glances/plugins/gpu/cards/amd.py10
-rw-r--r--glances/plugins/gpu/cards/nvidia.py1
-rw-r--r--glances/plugins/ip/__init__.py18
-rw-r--r--glances/plugins/irq/__init__.py4
-rw-r--r--glances/plugins/load/__init__.py8
-rw-r--r--glances/plugins/mem/__init__.py2
-rw-r--r--glances/plugins/network/__init__.py39
-rw-r--r--glances/plugins/now/__init__.py14
-rw-r--r--glances/plugins/percpu/__init__.py12
-rw-r--r--glances/plugins/plugin/model.py34
-rw-r--r--glances/plugins/ports/__init__.py5
-rw-r--r--glances/plugins/processcount/__init__.py5
-rw-r--r--glances/plugins/processlist/__init__.py9
-rw-r--r--glances/plugins/quicklook/__init__.py9
-rw-r--r--glances/plugins/sensors/__init__.py20
-rw-r--r--glances/plugins/system/__init__.py9
-rw-r--r--glances/plugins/wifi/__init__.py15
-rw-r--r--glances/ports_list.py1
-rw-r--r--glances/processes.py23
-rw-r--r--glances/server.py4
-rw-r--r--glances/snmp.py1
-rw-r--r--glances/standalone.py1
-rw-r--r--glances/static_list.py1
-rw-r--r--glances/stats.py5
-rw-r--r--glances/stats_client.py1
-rw-r--r--glances/stats_client_snmp.py1
-rw-r--r--glances/stats_server.py1
-rw-r--r--glances/thresholds.py5
-rw-r--r--glances/timer.py2
-rw-r--r--glances/web_list.py1
-rw-r--r--glances/webserver.py2
-rwxr-xr-xunitest.py20
88 files changed, 417 insertions, 563 deletions
diff --git a/Makefile b/Makefile
index c61a300d..57d96606 100644
--- a/Makefile
+++ b/Makefile
@@ -66,13 +66,13 @@ test: ## Run unit tests
./venv/bin/python ./unitest.py
./venv/bin/python ./unitest-restful.py
./venv/bin/python ./unitest-xmlrpc.py
- ./venv/bin/python -m black ./glances --check --exclude outputs/static
+ ./venv-dev/bin/python -m black ./glances --check --exclude outputs/static
test-with-upgrade: venv-upgrade venv-dev-upgrade ## Upgrade deps and run unit tests
./venv/bin/python ./unitest.py
./venv/bin/python ./unitest-restful.py
./venv/bin/python ./unitest-xmlrpc.py
- ./venv/bin/python -m black ./glances --check --exclude outputs/static
+ ./venv/bin-dev/python -m black ./glances --check --exclude outputs/static
test-min: ## Run unit tests in minimal environment
./venv-min/bin/python ./unitest.py
diff --git a/docs/api.rst b/docs/api.rst
index fb8ec54e..3ce53099 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -141,7 +141,7 @@ Get plugin stats::
"refresh": 3.0,
"regex": True,
"result": None,
- "timer": 0.3963778018951416},
+ "timer": 0.3574647903442383},
{"count": 0,
"countmax": 20.0,
"countmin": None,
@@ -150,7 +150,7 @@ Get plugin stats::
"refresh": 3.0,
"regex": True,
"result": None,
- "timer": 0.3962833881378174}]
+ "timer": 0.35736703872680664}]
Fields descriptions:
@@ -178,7 +178,7 @@ Get a specific item when field matches the given value::
"refresh": 3.0,
"regex": True,
"result": None,
- "timer": 0.3963778018951416}]}
+ "timer": 0.3574647903442383}]}
GET cloud
---------
@@ -219,7 +219,23 @@ GET containers
Get plugin stats::
# curl http://localhost:61208/api/4/containers
- []
+ [{"command": "tail -f /dev/null",
+ "cpu": {"total": 0.0},
+ "cpu_percent": 0.0,
+ "created": "2024-05-06T08:20:31.859934699Z",
+ "engine": "docker",
+ "id": "f8d78b334f789955ab6dd0739c0bbb7e26ae3f24ed9e42c4a0d218a30377d2c8",
+ "image": ["catthehacker/ubuntu:act-22.04"],
+ "io": {"cumulative_ior": 100855808, "cumulative_iow": 0},
+ "key": "name",
+ "memory": {"inactive_file": 1704656896,
+ "limit": 16422473728,
+ "usage": 1984933888},
+ "memory_usage": 1984933888,
+ "name": "act-test-test-freebsd-700362a4fd49fe930f7ab89909c5ca853cd3a832c27b6ac4e363947b0dd29bef",
+ "network": {},
+ "status": "running",
+ "uptime": "yesterday"}]
Fields descriptions:
@@ -240,6 +256,35 @@ Fields descriptions:
* **pod_name**: Pod name (only with Podman) (unit is *None*)
* **pod_id**: Pod ID (only with Podman) (unit is *None*)
+Get a specific field::
+
+ # curl http://localhost:61208/api/4/containers/name
+ {"name": ["act-test-test-freebsd-700362a4fd49fe930f7ab89909c5ca853cd3a832c27b6ac4e363947b0dd29bef"]}
+
+Get a specific item when field matches the given value::
+
+ # curl http://localhost:61208/api/4/containers/name/act-test-test-freebsd-700362a4fd49fe930f7ab89909c5ca853cd3a832c27b6ac4e363947b0dd29bef
+ {"act-test-test-freebsd-700362a4fd49fe930f7ab89909c5ca853cd3a832c27b6ac4e363947b0dd29bef": [{"command": "tail "
+ "-f "
+ "/dev/null",
+ "cpu": {"total": 0.0},
+ "cpu_percent": 0.0,
+ "created": "2024-05-06T08:20:31.859934699Z",
+ "engine": "docker",
+ "id": "f8d78b334f789955ab6dd0739c0bbb7e26ae3f24ed9e42c4a0d218a30377d2c8",
+ "image": ["catthehacker/ubuntu:act-22.04"],
+ "io": {"cumulative_ior": 100855808,
+ "cumulative_iow": 0},
+ "key": "name",
+ "memory": {"inactive_file": 1704656896,
+ "limit": 16422473728,
+ "usage": 1984933888},
+ "memory_usage": 1984933888,
+ "name": "act-test-test-freebsd-700362a4fd49fe930f7ab89909c5ca853cd3a832c27b6ac4e363947b0dd29bef",
+ "network": {},
+ "status": "running",
+ "uptime": "yesterday"}]}
+
GET core
--------
@@ -265,18 +310,18 @@ Get plugin stats::
# curl http://localhost:61208/api/4/cpu
{"cpucore": 16,
- "ctx_switches": 542181838,
+ "ctx_switches": 100084028,
"guest": 0.0,
"idle": 3.0,
- "interrupts": 420410414,
+ "interrupts": 99754405,
"iowait": 0.0,
"irq": 0.0,
"nice": 0.0,
- "soft_interrupts": 157550864,
+ "soft_interrupts": 30928307,
"steal": 0.0,
"syscalls": 0,
- "system": 0.0,
- "total": 0.0,
+ "system": 1.0,
+ "total": 25.0,
"user": 0.0}
Fields descriptions:
@@ -310,7 +355,7 @@ Fields descriptions:
Get a specific field::
# curl http://localhost:61208/api/4/cpu/total
- {"total": 0.0}
+ {"total": 25.0}
GET diskio
----------
@@ -320,14 +365,14 @@ Get plugin stats::
# curl http://localhost:61208/api/4/diskio
[{"disk_name": "nvme0n1",
"key": "disk_name",
- "read_bytes": 7451868160,
- "read_count": 348351,
- "write_bytes": 115766309888,
- "write_count": 3401479},
+ "read_bytes": 5494942208,
+ "read_count": 276248,
+ "write_bytes": 12631118848,
+ "write_count": 434825},
{"disk_name": "nvme0n1p1",
"key": "disk_name",
- "read_bytes": 7489024,
- "read_count": 601,
+ "read_bytes": 7484416,
+ "read_count": 592,
"write_bytes": 1024,
"write_count": 2}]
@@ -363,10 +408,10 @@ Get a specific item when field matches the given value::
# curl http://localhost:61208/api/4/diskio/disk_name/nvme0n1
{"nvme0n1": [{"disk_name": "nvme0n1",
"key": "disk_name",
- "read_bytes": 7451868160,
- "read_count": 348351,
- "write_bytes": 115766309888,
- "write_count": 3401479}]}
+ "read_bytes": 5494942208,
+ "read_count": 276248,
+ "write_bytes": 12631118848,
+ "write_count": 434825}]}
GET folders
-----------
@@ -393,13 +438,13 @@ Get plugin stats::
# curl http://localhost:61208/api/4/fs
[{"device_name": "/dev/mapper/ubuntu--vg-ubuntu--lv",
- "free": 915914182656,
+ "free": 906483245056,
"fs_type": "ext4",
"key": "mnt_point",
"mnt_point": "/",
- "percent": 3.9,
+ "percent": 4.8,
"size": 1003736440832,
- "used": 36759752704}]
+ "used": 46190690304}]
Fields descriptions:
@@ -420,13 +465,13 @@ Get a specific item when field matches the given value::
# curl http://localhost:61208/api/4/fs/mnt_point//
{"/": [{"device_name": "/dev/mapper/ubuntu--vg-ubuntu--lv",
- "free": 915914182656,
+ "free": 906483245056,
"fs_type": "ext4",
"key": "mnt_point",
"mnt_point": "/",
- "percent": 3.9,
+ "percent": 4.8,
"size": 1003736440832,
- "used": 36759752704}]}
+ "used": 46190690304}]}
GET gpu
-------
@@ -499,10 +544,7 @@ GET load
Get plugin stats::
# curl http://localhost:61208/api/4/load
- {"cpucore": 16,
- "min1": 1.8212890625,
- "min15": 1.0576171875,
- "min5": 1.2783203125}
+ {"cpucore": 16, "min1": 0.52685546875, "min15": 1.25390625, "min5": 1.544921875}
Fields descriptions:
@@ -514,7 +556,7 @@ Fields descriptions:
Get a specific field::
# curl http://localhost:61208/api/4/load/min1
- {"min1": 1.8212890625}
+ {"min1": 0.52685546875}
GET mem
-------
@@ -522,16 +564,16 @@ GET mem
Get plugin stats::
# curl http://localhost:61208/api/4/mem
- {"active": 5652090880,
- "available": 6879588352,
- "buffers": 609959936,
- "cached": 6387052544,
- "free": 6879588352,
- "inactive": 7342874624,
- "percent": 58.1,
- "shared": 1032945664,
- "total": 16422477824,
- "used": 9542889472}
+ {"active": 7115952128,
+ "available": 8999600128,
+ "buffers": 268685312,
+ "cached": 9109741568,
+ "free": 8999600128,
+ "inactive": 5429415936,
+ "percent": 45.2,
+ "shared": 1431875584,
+ "total": 16422473728,
+ "used": 7422873600}