From e8563a0fc4b0c0663f354deb0b846421f94a9f95 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Tue, 7 May 2024 11:49:55 +0200 Subject: Format code and update docs/webui --- docs/api.rst | 244 +++++++++++++++++++++++++++++++---------------------- docs/man/glances.1 | 2 +- 2 files changed, 144 insertions(+), 102 deletions(-) (limited to 'docs') 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} Fields descriptions: @@ -550,7 +592,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/4/mem/total - {"total": 16422477824} + {"total": 16422473728} GET memswap ----------- @@ -558,13 +600,13 @@ GET memswap Get plugin stats:: # curl http://localhost:61208/api/4/memswap - {"free": 4147900416, - "percent": 3.4, - "sin": 1359872, - "sout": 145010688, + {"free": 4293652480, + "percent": 0.0, + "sin": 0, + "sout": 131072, "time_since_update": 1, "total": 4294963200, - "used": 147062784} + "used": 1310720} Fields descriptions: @@ -589,15 +631,15 @@ Get plugin stats:: # curl http://localhost:61208/api/4/network [{"alias": None, "bytes_all": 0, - "bytes_all_gauge": 7230851205, + "bytes_all_gauge": 2153845053, "bytes_recv": 0, - "bytes_recv_gauge": 6965449347, + "bytes_recv_gauge": 2054902380, "bytes_sent": 0, - "bytes_sent_gauge": 265401858, + "bytes_sent_gauge": 98942673, "interface_name": "wlp0s20f3", "key": "interface_name", "speed": 0, - "time_since_update": 0.39971184730529785}] + "time_since_update": 0.37114882469177246}] Fields descriptions: @@ -626,15 +668,15 @@ Get a specific item when field matches the given value:: # curl http://localhost:61208/api/4/network/interface_name/wlp0s20f3 {"wlp0s20f3": [{"alias": None, "bytes_all": 0, - "bytes_all_gauge": 7230851205, + "bytes_all_gauge": 2153845053, "bytes_recv": 0, - "bytes_recv_gauge": 6965449347, + "bytes_recv_gauge": 2054902380, "bytes_sent": 0, - "bytes_sent_gauge": 265401858, + "bytes_sent_gauge": 98942673, "interface_name": "wlp0s20f3", "key": "interface_name", "speed": 0, - "time_since_update": 0.39971184730529785}]} + "time_since_update": 0.37114882469177246}]} GET now ------- @@ -642,7 +684,7 @@ GET now Get plugin stats:: # curl http://localhost:61208/api/4/now - {"custom": "2024-05-03 09:53:17 CEST", "iso": "2024-05-03T09:53:17+02:00"} + {"custom": "2024-05-07 11:46:44 CEST", "iso": "2024-05-07T11:46:44+02:00"} Fields descriptions: @@ -652,7 +694,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/4/now/iso - {"iso": "2024-05-03T09:53:17+02:00"} + {"iso": "2024-05-07T11:46:44+02:00"} GET percpu ---------- @@ -676,7 +718,7 @@ Get plugin stats:: {"cpu_number": 1, "guest": 0.0, "guest_nice": 0.0, - "idle": 0.0, + "idle": 1.0, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", @@ -684,7 +726,7 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 100.0, + "total": 99.0, "user": 0.0}] Fields descriptions: @@ -719,7 +761,7 @@ Get plugin stats:: "port": 0, "refresh": 30, "rtt_warning": None, - "status": 0.007143, + "status": 0.008626, "timeout": 3}] Fields descriptions: @@ -747,7 +789,7 @@ Get a specific item when field matches the given value:: "port": 0, "refresh": 30, "rtt_warning": None, - "status": 0.007143, + "status": 0.008626, "timeout": 3}]} GET processcount @@ -756,7 +798,7 @@ GET processcount Get plugin stats:: # curl http://localhost:61208/api/4/processcount - {"pid_max": 0, "running": 1, "sleeping": 292, "thread": 1754, "total": 428} + {"pid_max": 0, "running": 1, "sleeping": 287, "thread": 1710, "total": 432} Fields descriptions: @@ -769,7 +811,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/4/processcount/total - {"total": 428} + {"total": 432} GET processlist --------------- @@ -809,14 +851,14 @@ GET quicklook Get plugin stats:: # curl http://localhost:61208/api/4/quicklook - {"cpu": 0.0, + {"cpu": 25.0, "cpu_hz": 4475000000.0, - "cpu_hz_current": 1338323312.5, + "cpu_hz_current": 1527240625.0000005, "cpu_log_core": 16, "cpu_name": "13th Gen Intel(R) Core(TM) i7-13620H", "cpu_phys_core": 10, - "load": 6.6, - "mem": 58.1, + "load": 7.8, + "mem": 45.2, "percpu": [{"cpu_number": 0, "guest": 0.0, "guest_nice": 0.0, @@ -833,7 +875,7 @@ Get plugin stats:: {"cpu_number": 1, "guest": 0.0, "guest_nice": 0.0, - "idle": 0.0, + "idle": 1.0, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", @@ -841,7 +883,7 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 100.0, + "total": 99.0, "user": 0.0}, {"cpu_number": 2, "guest": 0.0, @@ -885,7 +927,7 @@ Get plugin stats:: {"cpu_number": 5, "guest": 0.0, "guest_nice": 0.0, - "idle": 1.0, + "idle": 0.0, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", @@ -893,7 +935,7 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 99.0, + "total": 100.0, "user": 0.0}, {"cpu_number": 6, "guest": 0.0, @@ -937,7 +979,7 @@ Get plugin stats:: {"cpu_number": 9, "guest": 0.0, "guest_nice": 0.0, - "idle": 0.0, + "idle": 1.0, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", @@ -945,7 +987,7 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 100.0, + "total": 99.0, "user": 0.0}, {"cpu_number": 10, "guest": 0.0, @@ -963,7 +1005,7 @@ Get plugin stats:: {"cpu_number": 11, "guest": 0.0, "guest_nice": 0.0, - "idle": 1.0, + "idle": 0.0, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", @@ -971,7 +1013,7 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 99.0, + "total": 100.0, "user": 0.0}, {"cpu_number": 12, "guest": 0.0, @@ -1015,7 +1057,7 @@ Get plugin stats:: {"cpu_number": 15, "guest": 0.0, "guest_nice": 0.0, - "idle": 0.0, + "idle": 1.0, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", @@ -1023,9 +1065,9 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 100.0, + "total": 99.0, "user": 0.0}], - "swap": 3.4} + "swap": 0.0} Fields descriptions: @@ -1063,7 +1105,7 @@ Get plugin stats:: "label": "Ambient", "type": "temperature_core", "unit": "C", - "value": 34, + "value": 35, "warning": 0}, {"critical": None, "key": "label", @@ -1131,7 +1173,7 @@ Get a specific item when field matches the given value:: "label": "Ambient", "type": "temperature_core", "unit": "C", - "value": 34, + "value": 35, "warning": 0}]} GET smart @@ -1175,7 +1217,7 @@ GET uptime Get plugin stats:: # curl http://localhost:61208/api/4/uptime - "5 days, 15:41:19" + "1 day, 2:23:04" GET version ----------- @@ -1192,8 +1234,8 @@ Get plugin stats:: # curl http://localhost:61208/api/4/wifi [{"key": "ssid", - "quality_level": -57.0, - "quality_link": 53.0, + "quality_level": -61.0, + "quality_link": 49.0, "ssid": "wlp0s20f3"}] Get a specific field:: @@ -1205,8 +1247,8 @@ Get a specific item when field matches the given value:: # curl http://localhost:61208/api/4/wifi/ssid/wlp0s20f3 {"wlp0s20f3": [{"key": "ssid", - "quality_level": -57.0, - "quality_link": 53.0, + "quality_level": -61.0, + "quality_link": 49.0, "ssid": "wlp0s20f3"}]} GET all stats @@ -1251,34 +1293,34 @@ GET stats history History of a plugin:: # curl http://localhost:61208/api/4/cpu/history - {"system": [["2024-05-03T09:53:18.269256", 0.0], - ["2024-05-03T09:53:19.320800", 0.0], - ["2024-05-03T09:53:20.396402", 0.0]], - "user": [["2024-05-03T09:53:18.269244", 0.0], - ["2024-05-03T09:53:19.320793", 1.0], - ["2024-05-03T09:53:20.396392", 1.0]]} + {"system": [["2024-05-07T11:46:45.322880", 1.0], + ["2024-05-07T11:46:46.376121", 0.0], + ["2024-05-07T11:46:47.453787", 0.0]], + "user": [["2024-05-07T11:46:45.322868", 0.0], + ["2024-05-07T11:46:46.376117", 0.0], + ["2024-05-07T11:46:47.453775", 0.0]]} Limit history to last 2 values:: # curl http://localhost:61208/api/4/cpu/history/2 - {"system": [["2024-05-03T09:53:19.320800", 0.0], - ["2024-05-03T09:53:20.396402", 0.0]], - "user": [["2024-05-03T09:53:19.320793", 1.0], - ["2024-05-03T09:53:20.396392", 1.0]]} + {"system": [["2024-05-07T11:46:46.376121", 0.0], + ["2024-05-07T11:46:47.453787", 0.0]], + "user": [["2024-05-07T11:46:46.376117", 0.0], + ["2024-05-07T11:46:47.453775", 0.0]]} History for a specific field:: # curl http://localhost:61208/api/4/cpu/system/history - {"system": [["2024-05-03T09:53:17.063839", 0.0], - ["2024-05-03T09:53:18.269256", 0.0], - ["2024-05-03T09:53:19.320800", 0.0], - ["2024-05-03T09:53:20.396402", 0.0]]} + {"system": [["2024-05-07T11:46:44.106241", 1.0], + ["2024-05-07T11:46:45.322880", 1.0], + ["2024-05-07T11:46:46.376121", 0.0], + ["2024-05-07T11:46:47.453787", 0.0]]} Limit history for a specific field to last 2 values:: # curl http://localhost:61208/api/4/cpu/system/history - {"system": [["2024-05-03T09:53:19.320800", 0.0], - ["2024-05-03T09:53:20.396402", 0.0]]} + {"system": [["2024-05-07T11:46:46.376121", 0.0], + ["2024-05-07T11:46:47.453787", 0.0]]} GET limits (used for thresholds) -------------------------------- diff --git a/docs/man/glances.1 b/docs/man/glances.1 index 74dc668a..a93123b3 100644 --- a/docs/man/glances.1 +++ b/docs/man/glances.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "GLANCES" "1" "May 03, 2024" "4.0.0_rc02" "Glances" +.TH "GLANCES" "1" "May 07, 2024" "4.0.0_rc02" "Glances" .SH NAME glances \- An eye on your system .SH SYNOPSIS -- cgit v1.2.3