From 02752f90eac526e6b84b9c9da577b700c4c7dabf Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sat, 1 Nov 2025 15:29:34 +0100 Subject: [PATCH] Remove duplicate line at the end of file and update doc for Glances 4.4.0RC1 --- all-requirements.txt | 2 +- dev-requirements.txt | 2 +- docker-requirements.txt | 2 +- docs/api/python.rst | 2252 ++++++++++++-- docs/api/restful.rst | 2832 ++++++++++++++++-- docs/man/glances.1 | 2 +- glances/__init__.py | 3 +- glances/outputs/glances_restful_api.py | 2 - glances/plugins/containers/engines/podman.py | 1 - glances/plugins/processlist/__init__.py | 4 - glances/plugins/quicklook/__init__.py | 1 - glances/ports_list.py | 1 - glances/stats.py | 2 - snap/snapcraft.yaml | 17 +- 14 files changed, 4519 insertions(+), 604 deletions(-) diff --git a/all-requirements.txt b/all-requirements.txt index a823a832..d11f5899 100644 --- a/all-requirements.txt +++ b/all-requirements.txt @@ -220,7 +220,7 @@ sniffio==1.3.1 # elasticsearch sparklines==0.7.0 # via glances -starlette==0.49.1 +starlette==0.49.2 # via fastapi statsd==4.0.1 # via glances diff --git a/dev-requirements.txt b/dev-requirements.txt index c450e565..3b25ef8b 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -414,7 +414,7 @@ sphinxcontrib-serializinghtml==2.0.0 # via sphinx sse-starlette==3.0.3 ; python_full_version >= '3.10' # via mcp -starlette==0.49.1 ; python_full_version >= '3.10' +starlette==0.49.2 ; python_full_version >= '3.10' # via mcp tomli==2.0.2 # via diff --git a/docker-requirements.txt b/docker-requirements.txt index d8b69a73..b8696713 100644 --- a/docker-requirements.txt +++ b/docker-requirements.txt @@ -59,7 +59,7 @@ six==1.17.0 # python-dateutil sniffio==1.3.1 # via anyio -starlette==0.49.1 +starlette==0.49.2 # via fastapi tomli==2.0.2 ; python_full_version < '3.11' # via podman diff --git a/docs/api/python.rst b/docs/api/python.rst index b4fedd62..b746d3e2 100644 --- a/docs/api/python.rst +++ b/docs/api/python.rst @@ -22,25 +22,25 @@ use the following code: >>> gl = api.GlancesAPI() >>> gl.cpu {'cpucore': 16, - 'ctx_switches': 1105771729, + 'ctx_switches': 1159147134, 'guest': 0.0, - 'idle': 89.0, - 'interrupts': 908552456, + 'idle': 92.6, + 'interrupts': 948488687, 'iowait': 0.4, 'irq': 0.0, 'nice': 0.0, - 'soft_interrupts': 385371712, + 'soft_interrupts': 405170160, 'steal': 0.0, 'syscalls': 0, - 'system': 6.1, - 'total': 8.1, - 'user': 4.5} + 'system': 4.5, + 'total': 6.9, + 'user': 2.4} >>> gl.cpu["total"] - 8.1 + 6.9 >>> gl.mem["used"] - 11819129472 + 11522931328 >>> gl.auto_unit(gl.mem["used"]) - 11.0G + 10.7G If the stats return a list of items (like network interfaces or processes), you can access them by their name: @@ -51,19 +51,19 @@ access them by their name: ['wlp0s20f3', 'veth33b370c'] >>> gl.network["wlp0s20f3"] {'alias': None, - 'bytes_all': 1849, - 'bytes_all_gauge': 8929939653, - 'bytes_all_rate_per_sec': 12306.0, - 'bytes_recv': 1481, - 'bytes_recv_gauge': 7217068231, - 'bytes_recv_rate_per_sec': 9856.0, - 'bytes_sent': 368, - 'bytes_sent_gauge': 1712871422, - 'bytes_sent_rate_per_sec': 2449.0, + 'bytes_all': 640, + 'bytes_all_gauge': 9102835582, + 'bytes_all_rate_per_sec': 1818.0, + 'bytes_recv': 382, + 'bytes_recv_gauge': 7354549965, + 'bytes_recv_rate_per_sec': 1085.0, + 'bytes_sent': 258, + 'bytes_sent_gauge': 1748285617, + 'bytes_sent_rate_per_sec': 733.0, 'interface_name': 'wlp0s20f3', 'key': 'interface_name', 'speed': 0, - 'time_since_update': 0.1502518653869629} + 'time_since_update': 0.351900577545166} Init Glances Python API ----------------------- @@ -95,30 +95,30 @@ Alert stats: >>> type(gl.alert) >>> gl.alert - [{'avg': 78.58484133228428, - 'begin': 1761989183, + [{'avg': 77.42645971914264, + 'begin': 1762005808, 'count': 2, 'desc': '', 'end': -1, 'global_msg': 'High swap (paging) usage', - 'max': 78.58484133228428, - 'min': 78.58484133228428, + 'max': 77.42650740290394, + 'min': 77.42641203538135, 'sort': 'memory_percent', 'state': 'WARNING', - 'sum': 157.16968266456857, + 'sum': 154.85291943828528, 'top': [], 'type': 'MEMSWAP'}, - {'avg': 71.89904841388805, - 'begin': 1761989183, + {'avg': 70.17486404131199, + 'begin': 1762005808, 'count': 2, 'desc': '', 'end': -1, 'global_msg': 'High swap (paging) usage', - 'max': 71.96749851602074, - 'min': 71.83059831175537, + 'max': 70.18580059433992, + 'min': 70.16392748828405, 'sort': 'memory_percent', 'state': 'WARNING', - 'sum': 143.7980968277761, + 'sum': 140.34972808262398, 'top': [], 'type': 'MEM'}] @@ -161,7 +161,7 @@ Ports stats: 'port': 0, 'refresh': 30, 'rtt_warning': None, - 'status': 0.005676, + 'status': 0.009703, 'timeout': 3}] Ports fields description: @@ -202,14 +202,14 @@ Diskio stats: >>> gl.diskio["nvme0n1"] {'disk_name': 'nvme0n1', 'key': 'disk_name', - 'read_bytes': 37580089856, - 'read_count': 2225108, + 'read_bytes': 38194215424, + 'read_count': 2256909, 'read_latency': 0, - 'read_time': 734320, - 'write_bytes': 73558672384, - 'write_count': 6628267, + 'read_time': 752911, + 'write_bytes': 75910816768, + 'write_count': 6762675, 'write_latency': 0, - 'write_time': 6082658} + 'write_time': 6371861} Diskio fields description: @@ -276,7 +276,7 @@ Containers stats: 'network_tx': None, 'ports': '9090->9090/tcp', 'status': 'running', - 'uptime': '6 mins'} + 'uptime': '4 hours'} Containers fields description: @@ -321,11 +321,11 @@ Processcount stats: >>> type(gl.processcount) >>> gl.processcount - {'pid_max': 0, 'running': 1, 'sleeping': 437, 'thread': 2472, 'total': 590} + {'pid_max': 0, 'running': 1, 'sleeping': 434, 'thread': 2369, 'total': 591} >>> gl.processcount.keys() ['total', 'running', 'sleeping', 'thread', 'pid_max'] >>> gl.processcount["total"] - 590 + 591 Processcount fields description: @@ -398,7 +398,7 @@ Percpu stats: 'dpc': None, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 27.0, + 'idle': 44.0, 'interrupt': None, 'iowait': 0.0, 'irq': 0.0, @@ -406,8 +406,8 @@ Percpu stats: 'nice': 0.0, 'softirq': 0.0, 'steal': 0.0, - 'system': 10.0, - 'total': 73.0, + 'system': 11.0, + 'total': 56.0, 'user': 0.0} Percpu fields description: @@ -498,18 +498,18 @@ Network stats: >>> gl.network["wlp0s20f3"] {'alias': None, 'bytes_all': 0, - 'bytes_all_gauge': 8929939653, + 'bytes_all_gauge': 9102835582, 'bytes_all_rate_per_sec': 0.0, 'bytes_recv': 0, - 'bytes_recv_gauge': 7217068231, + 'bytes_recv_gauge': 7354549965, 'bytes_recv_rate_per_sec': 0.0, 'bytes_sent': 0, - 'bytes_sent_gauge': 1712871422, + 'bytes_sent_gauge': 1748285617, 'bytes_sent_rate_per_sec': 0.0, 'interface_name': 'wlp0s20f3', 'key': 'interface_name', 'speed': 0, - 'time_since_update': 0.0033087730407714844} + 'time_since_update': 0.0036220550537109375} Network fields description: @@ -550,23 +550,23 @@ Cpu stats: >>> gl.cpu {'cpucore': 16, - 'ctx_switches': 1105771729, + 'ctx_switches': 1159147134, 'guest': 0.0, - 'idle': 89.0, - 'interrupts': 908552456, + 'idle': 92.6, + 'interrupts': 948488687, 'iowait': 0.4, 'irq': 0.0, 'nice': 0.0, - 'soft_interrupts': 385371712, + 'soft_interrupts': 405170160, 'steal': 0.0, 'syscalls': 0, - 'system': 6.1, - 'total': 8.1, - 'user': 4.5} + 'system': 4.5, + 'total': 6.9, + 'user': 2.4} >>> gl.cpu.keys() ['total', 'user', 'nice', 'system', 'idle', 'iowait', 'irq', 'steal', 'guest', 'ctx_switches', 'interrupts', 'soft_interrupts', 'syscalls', 'cpucore'] >>> gl.cpu["total"] - 8.1 + 6.9 Cpu fields description: @@ -638,7 +638,7 @@ Amps stats: 'refresh': 3.0, 'regex': True, 'result': None, - 'timer': 0.17803120613098145} + 'timer': 0.33786940574645996} Amps fields description: @@ -669,7 +669,7 @@ Processlist stats: >>> gl.processlist Return a dict of dict with key= >>> gl.processlist.keys() - [1211585, 1209239, 739161, 1209523, 1316902, 1212589, 1225365, 1209604, 1224962, 1209611, 1209619, 1333270, 1348985, 1209632, 5654, 1338768, 464283, 1336297, 1212999, 1349000, 1209559, 446730, 1348984, 1311079, 1287223, 739044, 614914, 1318955, 6237, 1213613, 1349010, 18544, 1349017, 739264, 1211584, 1350217, 1352164, 1361184, 1209533, 1212055, 1352836, 1360735, 61459, 1356092, 739199, 1333449, 1212054, 1212053, 3476, 1212802, 1351260, 6612, 1212793, 1210327, 1212316, 732, 1209509, 9513, 1361181, 739578, 569516, 739105, 6069, 1212051, 1209504, 6225, 6652, 5857, 2993, 5990, 5770, 6512, 8666, 1212056, 5782, 6624, 5267, 6253, 614544, 6126, 2719, 5811, 5808, 688630, 5950, 1, 1350197, 5589, 6285, 14301, 5762, 6647, 2627, 614742, 5421, 2620, 1287017, 5265, 6013, 9878, 5245, 5789, 5262, 2655, 2652, 5800, 6211, 2990, 5836, 5794, 2653, 5830, 2953, 3051, 5813, 5214, 3503, 5885, 688600, 5268, 5784, 2493, 234055, 5833, 1287018, 7197, 739047, 3556, 6192, 20411, 20420, 6023, 614737, 5795, 2720, 2838, 2841, 2647, 14320, 5335, 2623, 6076, 2642, 5575, 794, 5631, 2616, 6142, 5281, 5871, 5832, 5740, 6060, 5961, 6035, 6046, 614691, 483484, 2645, 5586, 5947, 6085, 5786, 5821, 2648, 2492, 5560, 2494, 5339, 3487, 5404, 5826, 6153, 5561, 2615, 5646, 2634, 5263, 14326, 1293800, 408229, 11442, 614728, 739046, 614678, 2791, 1350169, 1350176, 6438, 2614, 2491, 1211852, 614677, 3670, 6654, 2619, 1209336, 1361175, 14329, 2873, 3500, 2874, 3489, 3526, 5252, 5346, 1342165, 3191, 3495, 1361180, 1286689, 3490, 1286685, 2875, 739062, 2718, 1287044, 3192, 1211841, 2, 3, 4, 5, 6, 7, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 77, 78, 79, 80, 81, 83, 84, 85, 86, 87, 89, 90, 91, 92, 93, 95, 96, 97, 98, 99, 101, 102, 103, 104, 105, 107, 108, 109, 110, 111, 113, 114, 115, 116, 117, 118, 121, 122, 123, 124, 125, 126, 127, 128, 134, 135, 136, 137, 138, 139, 140, 142, 145, 146, 147, 148, 149, 150, 152, 155, 156, 157, 158, 165, 176, 185, 186, 211, 233, 262, 263, 264, 265, 271, 274, 275, 276, 277, 278, 279, 356, 359, 361, 362, 363, 364, 365, 452, 453, 616, 621, 622, 623, 629, 664, 665, 766, 767, 801, 977, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1039, 1240, 1241, 1256, 1266, 1267, 1268, 1269, 1270, 1271, 1331, 1334, 1475, 1481, 1892, 1893, 1894, 1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902, 1903, 1904, 1905, 1934, 1935, 1936, 1938, 1939, 1940, 1941, 1943, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 2027, 2043, 2044, 2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 2053, 2054, 2055, 2056, 2058, 2059, 2060, 2061, 2062, 2063, 2064, 2066, 2068, 3390, 3522, 3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, 3948, 5125, 5134, 14316, 88766, 88767, 88768, 88769, 1267862, 1292648, 1293617, 1295627, 1300570, 1301700, 1316506, 1319150, 1321411, 1324227, 1328558, 1331752, 1331757, 1331758, 1332586, 1333049, 1333312, 1334123, 1334628, 1335477, 1335657, 1335658, 1335681, 1335897, 1337368, 1337380, 1337962, 1338339, 1338542, 1339972, 1340928, 1341576, 1341605, 1343600, 1343834, 1345149, 1346089, 1346090, 1346091, 1346092, 1346284, 1346921, 1347818, 1347821, 1347977, 1348200, 1349091, 1349990, 1350092, 1351017, 1351058, 1351243, 1351984, 1352146, 1352368, 1352372, 1352410, 1352642, 1354971, 1355014, 1360913] + [1211585, 1209239, 1209523, 1316902, 1212589, 739161, 1224962, 1209604, 1225365, 1209611, 1412561, 1209619, 5654, 1209632, 464283, 1212999, 1209559, 1348985, 446730, 1348984, 1311079, 1287223, 739044, 614914, 1349000, 1318955, 1213613, 6237, 1349010, 739264, 18544, 1349017, 1211584, 1209533, 1350217, 1416830, 1212055, 61459, 1414500, 1415696, 1414804, 739199, 1382036, 1212053, 1212054, 1212802, 1351260, 6612, 1210327, 1212793, 3476, 1212316, 732, 6069, 1209509, 9513, 1416827, 739578, 569516, 739105, 1212051, 1209504, 6225, 6652, 5857, 2993, 5770, 5990, 6512, 8666, 1212056, 5782, 6624, 5267, 6253, 614544, 6126, 2719, 5811, 5808, 1, 688630, 5950, 1350197, 6285, 5589, 14301, 5762, 6647, 2627, 614742, 5421, 2620, 1287017, 5265, 6013, 9878, 5245, 2652, 5789, 5262, 2655, 5800, 6211, 2990, 5836, 5794, 2653, 5830, 2953, 3051, 5813, 5214, 3503, 5885, 688600, 5268, 5784, 2493, 234055, 5833, 1287018, 7197, 739047, 3556, 6192, 20411, 20420, 614737, 6023, 5795, 2720, 2838, 2841, 2647, 14320, 5335, 2623, 6076, 2642, 5575, 794, 5631, 2616, 6142, 5281, 5871, 5832, 5740, 6060, 5961, 6035, 6046, 614691, 483484, 2645, 5586, 5947, 6085, 5786, 5821, 2648, 2492, 5560, 2494, 5339, 3487, 5404, 5826, 408229, 6153, 5561, 1381449, 2615, 5646, 2634, 5263, 14326, 11442, 614728, 739046, 614678, 2791, 1350169, 1350176, 6438, 2614, 2491, 1211852, 614677, 3670, 6654, 2619, 1209336, 14329, 2873, 1416821, 3500, 2874, 3489, 3526, 5252, 5346, 1412114, 3191, 3495, 1416826, 1286689, 3490, 1286685, 2875, 739062, 2718, 1287044, 3192, 1211841, 2, 3, 4, 5, 6, 7, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 77, 78, 79, 80, 81, 83, 84, 85, 86, 87, 89, 90, 91, 92, 93, 95, 96, 97, 98, 99, 101, 102, 103, 104, 105, 107, 108, 109, 110, 111, 113, 114, 115, 116, 117, 118, 121, 122, 123, 124, 125, 126, 127, 128, 134, 135, 136, 137, 138, 139, 140, 142, 145, 146, 147, 148, 149, 150, 152, 155, 156, 157, 158, 165, 176, 185, 186, 211, 233, 262, 263, 264, 265, 271, 274, 275, 276, 277, 278, 279, 356, 359, 361, 362, 363, 364, 365, 452, 453, 616, 621, 622, 623, 629, 664, 665, 766, 767, 801, 977, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1039, 1240, 1241, 1256, 1266, 1267, 1268, 1269, 1270, 1271, 1331, 1334, 1475, 1481, 1892, 1893, 1894, 1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902, 1903, 1904, 1905, 1934, 1935, 1936, 1938, 1939, 1940, 1941, 1943, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 2027, 2043, 2044, 2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 2053, 2054, 2055, 2056, 2058, 2059, 2060, 2061, 2062, 2063, 2064, 2066, 2068, 3390, 3522, 3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, 3948, 5125, 5134, 14316, 88766, 88767, 88768, 88769, 1347821, 1367851, 1376378, 1379781, 1381156, 1381183, 1381193, 1381200, 1381818, 1383934, 1392881, 1393978, 1394352, 1395218, 1396940, 1397281, 1397419, 1398096, 1398753, 1399178, 1400256, 1400825, 1401161, 1403285, 1404176, 1404177, 1404178, 1404179, 1405068, 1405097, 1408038, 1408119, 1408414, 1409839, 1410062, 1410063, 1410064, 1410150, 1410206, 1411012, 1411105, 1412785, 1413033, 1413034, 1413157, 1413320, 1413352, 1413561, 1413929, 1414017, 1414156, 1414306, 1414696, 1414910, 1414911, 1415007, 1415327, 1415678, 1415951, 1416012, 1416216, 1416798, 1416801, 1416802, 1416856] >>> gl.processlist["1211585"] {'cmdline': ['/proc/self/exe', '--type=utility', @@ -694,43 +694,38 @@ Processlist stats: '--enable-features=DocumentPolicyIncludeJSCallStacksInCrashReports,EarlyEstablishGpuChannel,EstablishGpuChannelAsync', '--disable-features=CalculateNativeWinOcclusion,FontationsLinuxSystemFonts,ScreenAIOCREnabled,SpareRendererForSitePerProcess', '--variations-seed-version'], - 'cpu_percent': 6.0, - 'cpu_times': {'children_system': 365.89, - 'children_user': 209.39, + 'cpu_percent': 0.0, + 'cpu_times': {'children_system': 484.59, + 'children_user': 253.73, 'iowait': 0.0, - 'system': 309.61, - 'user': 3136.94}, + 'system': 445.4, + 'user': 3483.91}, 'gids': {'effective': 1000, 'real': 1000, 'saved': 1000}, - 'io_counters': [860003328, - 857522176, - 860003328, - 857522176, + 'io_counters': [871562240, + 936493056, + 871562240, + 936493056, 1, - 264663040, - 425984, - 264663040, - 425984, + 150896640, + 1785856, + 150896640, + 1785856, 1, - 146366464, - 1560576, - 146366464, - 1560576, + 265695232, + 434176, + 265695232, + 434176, + 1, + 189501440, + 0, + 189501440, + 0, 1, 6549504, 8192, 6549504, 8192, 1, - 187109376, - 0, - 187109376, - 0, - 1, - 5561344, - 0, - 5561344, - 0, - 1, 2169856, 8192, 2169856, @@ -741,14 +736,19 @@ Processlist stats: 37666816, 1306624, 1, - 798051328, - 1101725696, - 798051328, - 1101725696, + 820237312, + 1112899584, + 820237312, + 1112899584, 1, - 9732096, + 5561344, 0, - 9732096, + 5561344, + 0, + 1, + 9895936, + 0, + 9895936, 0, 1, 8621056, @@ -756,19 +756,19 @@ Processlist stats: 8621056, 5234688, 1, + 92611584, + 928796672, + 92611584, + 928796672, + 1, 12394496, 0, 12394496, 0, 1, - 92167168, - 928555008, - 92167168, - 928555008, - 1, - 44052480, + 46157824, 0, - 44052480, + 46157824, 0, 1, 14960640, @@ -776,9 +776,9 @@ Processlist stats: 14960640, 0, 1, - 2839552, + 3081216, 0, - 2839552, + 3081216, 0, 1, 15736832, @@ -786,20 +786,20 @@ Processlist stats: 15736832, 0, 1, - 4866048, + 8032256, 0, - 4866048, + 8032256, 0, 1, - 13804544, + 13874176, 77824, - 13804544, + 13874176, 77824, 1, - 43334656, - 25112576, - 43334656, - 25112576, + 43543552, + 26492928, + 43543552, + 26492928, 1, 1704960, 36864, @@ -812,20 +812,20 @@ Processlist stats: 0, 1], 'key': 'pid', - 'memory_info': {'data': 4822876160, + 'memory_info': {'data': 4808552448, 'dirty': 0, 'lib': 0, - 'rss': 2184364032, - 'shared': 74330112, + 'rss': 2209005568, + 'shared': 74182656, 'text': 148733952, - 'vms': 1526384009216}, - 'memory_percent': 13.300743984895835, + 'vms': 1526384463872}, + 'memory_percent': 13.450788005457055, 'name': 'code', 'nice': 0, 'num_threads': 62, 'pid': 1211585, 'status': 'S', - 'time_since_update': 0.35088133811950684, + 'time_since_update': 0.6672391891479492, 'username': 'nicolargo'} Processlist fields description: @@ -910,13 +910,13 @@ Load stats: >>> gl.load {'cpucore': 16, - 'min1': 1.755859375, - 'min15': 1.095703125, - 'min5': 1.32666015625} + 'min1': 1.06591796875, + 'min15': 1.193359375, + 'min5': 1.2529296875} >>> gl.load.keys() ['min1', 'min5', 'min15', 'cpucore'] >>> gl.load["min1"] - 1.755859375 + 1.06591796875 Load fields description: @@ -955,7 +955,7 @@ Sensors stats: 'label': 'Ambient', 'type': 'temperature_core', 'unit': 'C', - 'value': 38, + 'value': 34, 'warning': 0} Sensors fields description: @@ -993,7 +993,7 @@ Uptime stats: >>> type(gl.uptime) >>> gl.uptime - '19 days, 15:32:47' + '19 days, 20:09:52' Uptime limits: @@ -1012,11 +1012,11 @@ Now stats: >>> type(gl.now) >>> gl.now - {'custom': '2025-11-01 10:26:23 CET', 'iso': '2025-11-01T10:26:23+01:00'} + {'custom': '2025-11-01 15:03:29 CET', 'iso': '2025-11-01T15:03:29+01:00'} >>> gl.now.keys() ['iso', 'custom'] >>> gl.now["iso"] - '2025-11-01T10:26:23+01:00' + '2025-11-01T15:03:29+01:00' Now fields description: @@ -1045,14 +1045,14 @@ Fs stats: ['/', '/zsfpool'] >>> gl.fs["/"] {'device_name': '/dev/mapper/ubuntu--vg-ubuntu--lv', - 'free': 712119742464, + 'free': 712562405376, 'fs_type': 'ext4', 'key': 'mnt_point', 'mnt_point': '/', 'options': 'rw,relatime', - 'percent': 25.3, + 'percent': 25.2, 'size': 1003736440832, - 'used': 240554192896} + 'used': 240111529984} Fs fields description: @@ -1092,8 +1092,8 @@ Wifi stats: ['wlp0s20f3'] >>> gl.wifi["wlp0s20f3"] {'key': 'ssid', - 'quality_level': -59.0, - 'quality_link': 51.0, + 'quality_level': -61.0, + 'quality_link': 49.0, 'ssid': 'wlp0s20f3'} Wifi limits: @@ -1159,7 +1159,7 @@ Version stats: >>> type(gl.version) >>> gl.version - '4.4.0_dev7' + '4.4.0rc1' Version limits: @@ -1225,16 +1225,16 @@ Mem stats: >>> type(gl.mem) >>> gl.mem - {'active': 8500617216, - 'available': 4603741568, - 'buffers': 249065472, - 'cached': 3894492800, - 'free': 1372172288, - 'inactive': 4348563456, - 'percent': 72.0, - 'shared': 781660160, + {'active': 8913620992, + 'available': 4899939712, + 'buffers': 342216704, + 'cached': 4175871616, + 'free': 897765376, + 'inactive': 4367450112, + 'percent': 70.2, + 'shared': 789905408, 'total': 16422871040, - 'used': 11819129472} + 'used': 11522931328} >>> gl.mem.keys() ['total', 'available', 'percent', 'used', 'free', 'active', 'inactive', 'buffers', 'cached', 'shared'] >>> gl.mem["total"] @@ -1304,19 +1304,19 @@ Quicklook stats: >>> type(gl.quicklook) >>> gl.quicklook - {'cpu': 8.1, + {'cpu': 6.9, 'cpu_hz': 4475000000.0, - 'cpu_hz_current': 1566476437.4999998, + 'cpu_hz_current': 872875937.5000001, 'cpu_log_core': 16, 'cpu_name': '13th Gen Intel(R) Core(TM) i7-13620H', 'cpu_phys_core': 10, - 'load': 6.8, - 'mem': 72.0, + 'load': 7.5, + 'mem': 70.2, 'percpu': [{'cpu_number': 0, 'dpc': None, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 27.0, + 'idle': 44.0, 'interrupt': None, 'iowait': 0.0, 'irq': 0.0, @@ -1324,14 +1324,14 @@ Quicklook stats: 'nice': 0.0, 'softirq': 0.0, 'steal': 0.0, - 'system': 10.0, - 'total': 73.0, + 'system': 11.0, + 'total': 56.0, 'user': 0.0}, {'cpu_number': 1, 'dpc': None, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 36.0, + 'idle': 56.0, 'interrupt': None, 'iowait': 0.0, 'irq': 0.0, @@ -1340,13 +1340,13 @@ Quicklook stats: 'softirq': 0.0, 'steal': 0.0, 'system': 0.0, - 'total': 64.0, + 'total': 44.0, 'user': 0.0}, {'cpu_number': 2, 'dpc': None, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 37.0, + 'idle': 56.0, 'interrupt': None, 'iowait': 0.0, 'irq': 0.0, @@ -1355,13 +1355,13 @@ Quicklook stats: 'softirq': 0.0, 'steal': 0.0, 'system': 0.0, - 'total': 63.0, - 'user': 0.0}, + 'total': 44.0, + 'user': 1.0}, {'cpu_number': 3, 'dpc': None, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 37.0, + 'idle': 57.0, 'interrupt': None, 'iowait': 0.0, 'irq': 0.0, @@ -1369,29 +1369,29 @@ Quicklook stats: 'nice': 0.0, 'softirq': 0.0, 'steal': 0.0, - 'system': 1.0, - 'total': 63.0, + 'system': 0.0, + 'total': 43.0, 'user': 0.0}, {'cpu_number': 4, 'dpc': None, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 22.0, + 'idle': 38.0, 'interrupt': None, - 'iowait': 1.0, + 'iowait': 2.0, 'irq': 0.0, 'key': 'cpu_number', 'nice': 0.0, 'softirq': 0.0, 'steal': 0.0, - 'system': 10.0, - 'total': 78.0, - 'user': 2.0}, + 'system': 11.0, + 'total': 62.0, + 'user': 3.0}, {'cpu_number': 5, 'dpc': None, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 35.0, + 'idle': 56.0, 'interrupt': None, 'iowait': 0.0, 'irq': 0.0, @@ -1399,14 +1399,14 @@ Quicklook stats: 'nice': 0.0, 'softirq': 0.0, 'steal': 0.0, - 'system': 1.0, - 'total': 65.0, + 'system': 0.0, + 'total': 44.0, 'user': 1.0}, {'cpu_number': 6, 'dpc': None, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 26.0, + 'idle': 48.0, 'interrupt': None, 'iowait': 0.0, 'irq': 0.0, @@ -1414,14 +1414,14 @@ Quicklook stats: 'nice': 0.0, 'softirq': 0.0, 'steal': 0.0, - 'system': 4.0, - 'total': 74.0, - 'user': 6.0}, + 'system': 6.0, + 'total': 52.0, + 'user': 1.0}, {'cpu_number': 7, 'dpc': None, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 36.0, + 'idle': 38.0, 'interrupt': None, 'iowait': 0.0, 'irq': 0.0, @@ -1429,104 +1429,29 @@ Quicklook stats: 'nice': 0.0, 'softirq': 0.0, 'steal': 0.0, - 'system': 0.0, - 'total': 64.0, - 'user': 0.0}, + 'system': 5.0, + 'total': 62.0, + 'user': 12.0}, {'cpu_number': 8, 'dpc': None, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 34.0, + 'idle': 53.0, 'interrupt': None, - 'iowait': 1.0, + 'iowait': 0.0, 'irq': 0.0, 'key': 'cpu_number', 'nice': 0.0, 'softirq': 0.0, 'steal': 0.0, 'system': 0.0, - 'total': 66.0, - 'user': 1.0}, + 'total': 47.0, + 'user': 2.0}, {'cpu_number': 9, 'dpc': None, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 36.0, - 'interrupt': None, - 'iowait': 0.0, - 'irq': 0.0, - 'key': 'cpu_number', - 'nice': 0.0, - 'softirq': 0.0, - 'steal': 0.0, - 'system': 1.0, - 'total': 64.0, - 'user': 0.0}, - {'cpu_number': 10, - 'dpc': None, - 'guest': 0.0, - 'guest_nice': 0.0, - 'idle': 37.0, - 'interrupt': None, - 'iowait': 0.0, - 'irq': 0.0, - 'key': 'cpu_number', - 'nice': 0.0, - 'softirq': 0.0, - 'steal': 0.0, - 'system': 0.0, - 'total': 63.0, - 'user': 0.0}, - {'cpu_number': 11, - 'dpc': None, - 'guest': 0.0, - 'guest_nice': 0.0, - 'idle': 35.0, - 'interrupt': None, - 'iowait': 0.0, - 'irq': 0.0, - 'key': 'cpu_number', - 'nice': 0.0, - 'softirq': 0.0, - 'steal': 0.0, - 'system': 1.0, - 'total': 65.0, - 'user': 1.0}, - {'cpu_number': 12, - 'dpc': None, - 'guest': 0.0, - 'guest_nice': 0.0, - 'idle': 36.0, - 'interrupt': None, - 'iowait': 0.0, - 'irq': 0.0, - 'key': 'cpu_number', - 'nice': 0.0, - 'softirq': 0.0, - 'steal': 0.0, - 'system': 0.0, - 'total': 64.0, - 'user': 0.0}, - {'cpu_number': 13, - 'dpc': None, - 'guest': 0.0, - 'guest_nice': 0.0, - 'idle': 35.0, - 'interrupt': None, - 'iowait': 0.0, - 'irq': 0.0, - 'key': 'cpu_number', - 'nice': 0.0, - 'softirq': 0.0, - 'steal': 0.0, - 'system': 1.0, - 'total': 65.0, - 'user': 1.0}, - {'cpu_number': 14, - 'dpc': None, - 'guest': 0.0, - 'guest_nice': 0.0, - 'idle': 33.0, + 'idle': 54.0, 'interrupt': None, 'iowait': 1.0, 'irq': 0.0, @@ -1534,14 +1459,14 @@ Quicklook stats: 'nice': 0.0, 'softirq': 0.0, 'steal': 0.0, - 'system': 1.0, - 'total': 67.0, + 'system': 0.0, + 'total': 46.0, 'user': 1.0}, - {'cpu_number': 15, + {'cpu_number': 10, 'dpc': None, 'guest': 0.0, 'guest_nice': 0.0, - 'idle': 34.0, + 'idle': 52.0, 'interrupt': None, 'iowait': 0.0, 'irq': 0.0, @@ -1550,9 +1475,84 @@ Quicklook stats: 'softirq': 0.0, 'steal': 0.0, 'system': 0.0, - 'total': 66.0, + 'total': 48.0, + 'user': 3.0}, + {'cpu_number': 11, + 'dpc': None, + 'guest': 0.0, + 'guest_nice': 0.0, + 'idle': 57.0, + 'interrupt': None, + 'iowait': 0.0, + 'irq': 0.0, + 'key': 'cpu_number', + 'nice': 0.0, + 'softirq': 0.0, + 'steal': 0.0, + 'system': 0.0, + 'total': 43.0, + 'user': 0.0}, + {'cpu_number': 12, + 'dpc': None, + 'guest': 0.0, + 'guest_nice': 0.0, + 'idle': 55.0, + 'interrupt': None, + 'iowait': 0.0, + 'irq': 0.0, + 'key': 'cpu_number', + 'nice': 0.0, + 'softirq': 0.0, + 'steal': 0.0, + 'system': 0.0, + 'total': 45.0, + 'user': 1.0}, + {'cpu_number': 13, + 'dpc': None, + 'guest': 0.0, + 'guest_nice': 0.0, + 'idle': 56.0, + 'interrupt': None, + 'iowait': 0.0, + 'irq': 0.0, + 'key': 'cpu_number', + 'nice': 0.0, + 'softirq': 0.0, + 'steal': 0.0, + 'system': 0.0, + 'total': 44.0, + 'user': 0.0}, + {'cpu_number': 14, + 'dpc': None, + 'guest': 0.0, + 'guest_nice': 0.0, + 'idle': 56.0, + 'interrupt': None, + 'iowait': 0.0, + 'irq': 0.0, + 'key': 'cpu_number', + 'nice': 0.0, + 'softirq': 0.0, + 'steal': 0.0, + 'system': 0.0, + 'total': 44.0, + 'user': 0.0}, + {'cpu_number': 15, + 'dpc': None, + 'guest': 0.0, + 'guest_nice': 0.0, + 'idle': 57.0, + 'interrupt': None, + 'iowait': 0.0, + 'irq': 0.0, + 'key': 'cpu_number', + 'nice': 0.0, + 'softirq': 0.0, + 'steal': 0.0, + 'system': 0.0, + 'total': 43.0, 'user': 1.0}], - 'swap': 78.6} + 'swap': 77.4} >>> gl.quicklook.keys() ['cpu_name', 'cpu_hz_current', 'cpu_hz', 'cpu', 'percpu', 'mem', 'swap', 'cpu_log_core', 'cpu_phys_core', 'load'] >>> gl.quicklook["cpu_name"] @@ -1602,13 +1602,13 @@ Memswap stats: >>> type(gl.memswap) >>> gl.memswap - {'free': 919773184, - 'percent': 78.6, - 'sin': 3890126848, - 'sout': 14980149248, - 'time_since_update': 0.3526928424835205, + {'free': 969527296, + 'percent': 77.4, + 'sin': 3943362560, + 'sout': 14980153344, + 'time_since_update': 0.7461061477661133, 'total': 4294963200, - 'used': 3375190016} + 'used': 3325435904} >>> gl.memswap.keys() ['total', 'used', 'free', 'percent', 'sin', 'sout', 'time_since_update'] >>> gl.memswap["total"] @@ -1643,10 +1643,10 @@ Use auto_unit() function to generate a human-readable string with the unit: .. code-block:: python >>> gl.mem["used"] - 11819129472 + 11522931328 >>> gl.auto_unit(gl.mem["used"]) - 11.0G + 10.7G Args: @@ -1702,7 +1702,1735 @@ Use top_process() function to generate a list of top processes sorted by CPU or .. code-block:: python >>> gl.top_process() - [{'gids': {'real': 1000, 'effective': 1000, 'saved': 1000}, 'io_counters': [865858560, 2310115328, 865858560, 2310103040, 1], 'num_threads': 165, 'status': 'S', 'cpu_percent': 86.4, 'pid': 1209239, 'memory_info': {'rss': 705908736, 'vms': 30212091904, 'shared': 197472256, 'text': 610304, 'lib': 0, 'data': 1121816576, 'dirty': 0}, 'memory_percent': 4.2983272186736965, 'nice': 0, 'name': 'firefox', 'cpu_times': {'user': 1240.84, 'system': 381.15, 'children_user': 0.09, 'children_system': 1.17, 'iowait': 0.0}, 'key': 'pid', 'time_since_update': 0.35088133811950684, 'cmdline': ['/snap/firefox/7084/usr/lib/firefox/firefox'], 'username': 'nicolargo'}, {'gids': {'real': 1000, 'effective': 1000, 'saved': 1000}, 'io_counters': [860003328, 857522176, 860003328, 857522176, 1, 264663040, 425984, 264663040, 425984, 1, 146366464, 1560576, 146366464, 1560576, 1, 6549504, 8192, 6549504, 8192, 1, 187109376, 0, 187109376, 0, 1, 5561344, 0, 5561344, 0, 1, 2169856, 8192, 2169856, 8192, 1, 37666816, 1306624, 37666816, 1306624, 1, 798051328, 1101725696, 798051328, 1101725696, 1, 9732096, 0, 9732096, 0, 1, 8621056, 5234688, 8621056, 5234688, 1, 12394496, 0, 12394496, 0, 1, 92167168, 928555008, 92167168, 928555008, 1, 44052480, 0, 44052480, 0, 1, 14960640, 0, 14960640, 0, 1, 2839552, 0, 2839552, 0, 1, 15736832, 0, 15736832, 0, 1, 4866048, 0, 4866048, 0, 1, 13804544, 77824, 13804544, 77824, 1, 43334656, 25112576, 43334656, 25112576, 1, 1704960, 36864, 1704960, 36864, 1, 194560, 0, 194560, 0, 1], 'num_threads': 62, 'status': 'S', 'cpu_percent': 6.0, 'pid': 1211585, 'memory_info': {'rss': 2184364032, 'vms': 1526384009216, 'shared': 74330112, 'text': 148733952, 'lib': 0, 'data': 4822876160, 'dirty': 0}, 'memory_percent': 13.300743984895835, 'nice': 0, 'name': 'code', 'cpu_times': {'user': 3136.94, 'system': 309.61, 'children_user': 209.39, 'children_system': 365.89, 'iowait': 0.0}, 'key': 'pid', 'time_since_update': 0.35088133811950684, 'cmdline': ['/proc/self/exe', '--type=utility', '--utility-sub-type=node.mojom.NodeService', '--lang=en-US', '--service-sandbox-type=none', '--no-sandbox', '--dns-result-order=ipv4first', '--experimental-network-inspection', '--inspect-port=0', '--crashpad-handler-pid=739062', '--enable-crash-reporter=864d4bb7-dd20-4851-830f-29e81dd93517,no_channel', '--user-data-dir=/home/nicolargo/.config/Code', '--standard-schemes=vscode-webview,vscode-file', '--secure-schemes=vscode-webview,vscode-file', '--cors-schemes=vscode-webview,vscode-file', '--fetch-schemes=vscode-webview,vscode-file', '--service-worker-schemes=vscode-webview', '--code-cache-schemes=vscode-webview,vscode-file', '--shared-files=v8_context_snapshot_data:100', '--field-trial-handle=3,i,16476947824719290197,4720072013320928602,262144', '--enable-features=DocumentPolicyIncludeJSCallStacksInCrashReports,EarlyEstablishGpuChannel,EstablishGpuChannelAsync', '--disable-features=CalculateNativeWinOcclusion,FontationsLinuxSystemFonts,ScreenAIOCREnabled,SpareRendererForSitePerProcess', '--variations-seed-version'], 'username': 'nicolargo'}, {'gids': {'real': 1000, 'effective': 1000, 'saved': 1000}, 'io_counters': [7255040, 0, 7255040, 0, 1], 'num_threads': 29, 'status': 'S', 'cpu_percent': 3.0, 'pid': 1209523, 'memory_info': {'rss': 619003904, 'vms': 24993234944, 'shared': 111763456, 'text': 610304, 'lib': 0, 'data': 749641728, 'dirty': 0}, 'memory_percent': 3.769157673419812, 'nice': 0, 'name': 'WebExtensions', 'cpu_times': {'user': 250.21, 'system': 37.54, 'children_user': 0.0, 'children_system': 0.0, 'iowait': 0.0}, 'key': 'pid', 'time_since_update': 0.35088133811950684, 'cmdline': ['/snap/firefox/7084/usr/lib/firefox/firefox', '-contentproc', '-isForBrowser', '-prefsHandle', '0:39856', '-prefMapHandle', '1:278271', '-jsInitHandle', '2:224660', '-parentBuildID', '20251017115341', '-sandboxReporter', '3', '-chrootClient', '4', '-ipcHandle', '5', '-initialChannelId', '{dedbeb09-6fe3-42c8-9c1d-5394b07e14d3}', '-parentPid', '1209239', '-crashReporter', '6', '-crashHelper', '7', '-greomni', '/snap/firefox/7084/usr/lib/firefox/omni.ja', '-appomni', '/snap/firefox/7084/usr/lib/firefox/browser/omni.ja', '-appDir', '/snap/firefox/7084/usr/lib/firefox/browser', '3', 'tab'], 'username': 'nicolargo'}] + [{'pid': 614914, 'nice': 0, 'name': 'editors_helper', 'status': 'S', 'cpu_percent': 6.3, 'memory_info': {'rss': 131670016, 'vms': 61897965568, 'shared': 9834496, 'text': 782336, 'lib': 0, 'data': 480088064, 'dirty': 0}, 'memory_percent': 0.8017478532182397, 'gids': {'real': 1000, 'effective': 1000, 'saved': 1000}, 'cpu_times': {'user': 6252.97, 'system': 947.74, 'children_user': 0.0, 'children_system': 0.0, 'iowait': 0.0}, 'io_counters': [42764288, 4452352, 42764288, 4452352, 1, 20907008, 303104, 20907008, 303104, 1, 34881536, 2019328, 34881536, 2019328, 1, 45486080, 0, 45486080, 0, 1, 1403904, 20480, 1403904, 20480, 1, 640000, 0, 640000, 0, 1, 2560000, 0, 2560000, 0, 1], 'num_threads': 12, 'key': 'pid', 'time_since_update': 0.6672391891479492, 'cmdline': ['/snap/onlyoffice-desktopeditors/746/opt/onlyoffice/desktopeditors/editors_helper', '--type=zygote', '--no-sandbox', '--force-device-scale-factor=1', '--log-severity=disable', '--user-agent-product=Chrome/109.0.0.0 AscDesktopEditor/9.1.0.173', '--lang=en-US', '--user-data-dir=/home/nicolargo/snap/onlyoffice-desktopeditors/746/.local/share/onlyoffice/desktopeditors/data/cache', '--log-file=/home/nicolargo/snap/onlyoffice-desktopeditors/746/.local/share/onlyoffice/desktopeditors/data/cache/log.log'], 'username': 'nicolargo'}, {'pid': 614544, 'nice': 0, 'name': 'DesktopEditors', 'status': 'S', 'cpu_percent': 6.3, 'memory_info': {'rss': 17346560, 'vms': 3240562688, 'shared': 10362880, 'text': 2777088, 'lib': 0, 'data': 429776896, 'dirty': 0}, 'memory_percent': 0.10562440609653598, 'gids': {'real': 1000, 'effective': 1000, 'saved': 1000}, 'cpu_times': {'user': 4247.55, 'system': 1435.96, 'children_user': 38.53, 'children_system': 3.75, 'iowait': 0.0}, 'io_counters': [1058653184, 70963200, 1058653184, 70963200, 1], 'num_threads': 23, 'key': 'pid', 'time_since_update': 0.6672391891479492, 'cmdline': ['./DesktopEditors'], 'username': 'nicolargo'}, {'pid': 1348985, 'nice': 0, 'name': 'code', 'status': 'S', 'cpu_percent': 3.2, 'memory_info': {'rss': 210812928, 'vms': 1494546030592, 'shared': 67756032, 'text': 148733952, 'lib': 0, 'data': 768196608, 'dirty': 0}, 'memory_percent': 1.2836545296284565, 'gids': {'real': 1000, 'effective': 1000, 'saved': 1000}, 'cpu_times': {'user': 14.35, 'system': 1.06, 'children_user': 0.0, 'children_system': 0.0, 'iowait': 0.0}, 'io_counters': [6549504, 8192, 6549504, 8192, 1], 'num_threads': 8, 'key': 'pid', 'time_since_update': 0.6672391891479492, 'cmdline': ['/snap/code/211/usr/share/code/code', '--max-old-space-size=3072', '/snap/code/211/usr/share/code/resources/app/extensions/node_modules/typescript/lib/tsserver.js', '--useInferredProjectPerProjectRoot', '--enableTelemetry', '--cancellationPipeName', '/tmp/vscode-typescript1000/f6d1387b124aae69bc56/tscancellation-0105757f6abe2947a9eb.tmp*', '--globalPlugins', '@vscode/copilot-typescript-server-plugin,@vsintellicode/typescript-intellicode-plugin,ms-vsintellicode-typescript,vue-reactivity-analysis-plugin-pack,vue-typescript-plugin-pack', '--pluginProbeLocations', '/home/nicolargo/.vscode/extensions/github.copilot-chat-0.32.4,/home/nicolargo/.vscode/extensions/visualstudioexptteam.vscodeintellicode-1.3.2,/home/nicolargo/.vscode/extensions/visualstudioexptteam.vscodeintellicode-1.3.2,/home/nicolargo/.vscode/extensions/vue.volar-3.1.2,/home/nicolargo/.vscode/extensions/vue.volar-3.1.2', '--locale', 'en', '--noGetErrOnBackgroundUpdate', '--canUseWatchEvents', '--validateDefaultNpmLocation', '--useNodeIpc'], 'username': 'nicolargo'}] + + +Args: + + limit (int, optional): The maximum number of top processes to return. Defaults to 3. + + sorted_by (str, optional): The primary key to sort processes by (e.g., 'cpu_percent'). + Defaults to 'cpu_percent'. + + sorted_by_secondary (str, optional): The secondary key to sort processes by if primary keys are equal + (e.g., 'memory_percent'). Defaults to 'memory_percent'. + +Returns: + + list: A list of dictionaries representing the top processes, excluding those with 'glances' in their + command line. + +Note: + + The 'glances' process is excluded from the returned list to avoid self-generated CPU load affecting + the results. + + +.. _api: + +Python API documentation +======================== + +This documentation describes the Glances Python API. + +Note: This API is only available in Glances 4.4.0 or higher. + + +TL;DR +----- + +You can access the Glances API by importing the `glances.api` module and creating an +instance of the `GlancesAPI` class. This instance provides access to all Glances plugins +and their fields. For example, to access the CPU plugin and its total field, you can +use the following code: + +.. code-block:: python + + >>> from glances import api + >>> gl = api.GlancesAPI() + >>> gl.cpu + {'cpucore': 16, + 'ctx_switches': 1159163052, + 'guest': 0.0, + 'idle': 91.0, + 'interrupts': 948499511, + 'iowait': 0.6, + 'irq': 0.0, + 'nice': 0.0, + 'soft_interrupts': 405176594, + 'steal': 0.0, + 'syscalls': 0, + 'system': 4.9, + 'total': 6.9, + 'user': 3.4} + >>> gl.cpu["total"] + 6.9 + >>> gl.mem["used"] + 11521763968 + >>> gl.auto_unit(gl.mem["used"]) + 10.7G + +If the stats return a list of items (like network interfaces or processes), you can +access them by their name: + +.. code-block:: python + + >>> gl.network.keys() + ['wlp0s20f3', 'veth33b370c'] + >>> gl.network["wlp0s20f3"] + {'alias': None, + 'bytes_all': 0, + 'bytes_all_gauge': 9103063926, + 'bytes_all_rate_per_sec': 0.0, + 'bytes_recv': 0, + 'bytes_recv_gauge': 7354763622, + 'bytes_recv_rate_per_sec': 0.0, + 'bytes_sent': 0, + 'bytes_sent_gauge': 1748300304, + 'bytes_sent_rate_per_sec': 0.0, + 'interface_name': 'wlp0s20f3', + 'key': 'interface_name', + 'speed': 0, + 'time_since_update': 0.36308836936950684} + +Init Glances Python API +----------------------- + +Init the Glances API: + +.. code-block:: python + + >>> from glances import api + >>> gl = api.GlancesAPI() + +Get Glances plugins list +------------------------ + +Get the plugins list: + +.. code-block:: python + + >>> gl.plugins() + ['alert', 'ports', 'diskio', 'containers', 'processcount', 'programlist', 'gpu', 'percpu', 'system', 'network', 'cpu', 'amps', 'processlist', 'load', 'sensors', 'uptime', 'now', 'fs', 'wifi', 'ip', 'help', 'version', 'psutilversion', 'core', 'mem', 'folders', 'quicklook', 'memswap'] + +Glances alert +------------- + +Alert stats: + +.. code-block:: python + + >>> type(gl.alert) + + >>> gl.alert + [{'avg': 77.4263881935007, + 'begin': 1762005808, + 'count': 4, + 'desc': '', + 'end': -1, + 'global_msg': 'High swap (paging) usage', + 'max': 77.42650740290394, + 'min': 77.42631666785876, + 'sort': 'memory_percent', + 'state': 'WARNING', + 'sum': 309.7055527740028, + 'top': [], + 'type': 'MEMSWAP'}, + {'avg': 70.18635552776038, + 'begin': 1762005808, + 'count': 4, + 'desc': '', + 'end': -1, + 'global_msg': 'High swap (paging) usage', + 'max': 70.238874676081, + 'min': 70.15681935233658, + 'sort': 'memory_percent', + 'state': 'WARNING', + 'sum': 280.74542211104153, + 'top': [], + 'type': 'MEM'}] + +Alert fields description: + +* begin: Begin timestamp of the event +* end: End timestamp of the event (or -1 if ongoing) +* state: State of the event (WARNING|CRITICAL) +* type: Type of the event (CPU|LOAD|MEM) +* max: Maximum value during the event period +* avg: Average value during the event period +* min: Minimum value during the event period +* sum: Sum of the values during the event period +* count: Number of values during the event period +* top: Top 3 processes name during the event period +* desc: Description of the event +* sort: Sort key of the top processes +* global_msg: Global alert message + +Alert limits: + +.. code-block:: python + + >>> gl.alert.limits + {'alert_disable': ['False'], 'history_size': 1200.0} + +Glances ports +------------- + +Ports stats: + +.. code-block:: python + + >>> type(gl.ports) + + >>> gl.ports + [{'description': 'DefaultGateway', + 'host': '192.168.1.1', + 'indice': 'port_0', + 'port': 0, + 'refresh': 30, + 'rtt_warning': None, + 'status': 0.007407, + 'timeout': 3}] + +Ports fields description: + +* host: Measurement is be done on this host (or IP address) +* port: Measurement is be done on this port (0 for ICMP) +* description: Human readable description for the host/port +* refresh: Refresh time (in seconds) for this host/port +* timeout: Timeout (in seconds) for the measurement +* status: Measurement result (in seconds) +* rtt_warning: Warning threshold (in seconds) for the measurement +* indice: Unique indice for the host/port + +Ports limits: + +.. code-block:: python + + >>> gl.ports.limits + {'history_size': 1200.0, + 'ports_disable': ['False'], + 'ports_port_default_gateway': ['True'], + 'ports_refresh': 30.0, + 'ports_timeout': 3.0} + +Glances diskio +-------------- + +Diskio stats: + +.. code-block:: python + + >>> type(gl.diskio) + + >>> gl.diskio + Return a dict of dict with key= + >>> gl.diskio.keys() + ['nvme0n1', 'nvme0n1p1', 'nvme0n1p2', 'nvme0n1p3', 'dm-0', 'dm-1'] + >>> gl.diskio["nvme0n1"] + {'disk_name': 'nvme0n1', + 'key': 'disk_name', + 'read_bytes': 38194465280, + 'read_count': 2256945, + 'read_latency': 0, + 'read_time': 752941, + 'write_bytes': 75912164352, + 'write_count': 6762826, + 'write_latency': 0, + 'write_time': 6371910} + +Diskio fields description: + +* disk_name: Disk name. +* read_count: Number of reads. +* write_count: Number of writes. +* read_bytes: Number of bytes read. +* write_bytes: Number of bytes written. +* read_time: Time spent reading. +* write_time: Time spent writing. +* read_latency: Mean time spent reading per operation. +* write_latency: Mean time spent writing per operation. + +Diskio limits: + +.. code-block:: python + + >>> gl.diskio.limits + {'diskio_disable': ['False'], + 'diskio_hide': ['loop.*', '/dev/loop.*'], + 'diskio_hide_zero': ['False'], + 'diskio_rx_latency_careful': 10.0, + 'diskio_rx_latency_critical': 50.0, + 'diskio_rx_latency_warning': 20.0, + 'diskio_tx_latency_careful': 10.0, + 'diskio_tx_latency_critical': 50.0, + 'diskio_tx_latency_warning': 20.0, + 'history_size': 1200.0} + +Glances containers +------------------ + +Containers stats: + +.. code-block:: python + + >>> type(gl.containers) + + >>> gl.containers + Return a dict of dict with key= + >>> gl.containers.keys() + ['prometheus-for-glances'] + >>> gl.containers["prometheus-for-glances"] + {'command': '/bin/prometheus --config.file=/etc/prometheus/prometheus.yml ' + '--storage.tsdb.path=/prometheus', + 'cpu': {'total': 0.0}, + 'cpu_percent': 0.0, + 'created': '2025-11-01T09:20:16.634313506Z', + 'engine': 'docker', + 'id': 'cbe33e3b3d30eedd1617b22723952c703e0105334b2e44a90fadf0bb0d1cbce9', + 'image': ('prom/prometheus:latest',), + 'io': {}, + 'io_rx': None, + 'io_wx': None, + 'key': 'name', + 'memory': {}, + 'memory_inactive_file': None, + 'memory_limit': None, + 'memory_percent': None, + 'memory_usage': None, + 'name': 'prometheus-for-glances', + 'network': {}, + 'network_rx': None, + 'network_tx': None, + 'ports': '9090->9090/tcp', + 'status': 'running', + 'uptime': '4 hours'} + +Containers fields description: + +* name: Container name +* id: Container ID +* image: Container image +* status: Container status +* created: Container creation date +* command: Container command +* cpu_percent: Container CPU consumption +* memory_inactive_file: Container memory inactive file +* memory_limit: Container memory limit +* memory_usage: Container memory usage +* io_rx: Container IO bytes read rate +* io_wx: Container IO bytes write rate +* network_rx: Container network RX bitrate +* network_tx: Container network TX bitrate +* ports: Container ports +* uptime: Container uptime +* engine: Container engine (Docker and Podman are currently supported) +* pod_name: Pod name (only with Podman) +* pod_id: Pod ID (only with Podman) + +Containers limits: + +.. code-block:: python + + >>> gl.containers.limits + {'containers_all': ['False'], + 'containers_disable': ['False'], + 'containers_disable_stats': ['command'], + 'containers_max_name_size': 20.0, + 'history_size': 1200.0} + +Glances processcount +-------------------- + +Processcount stats: + +.. code-block:: python + + >>> type(gl.processcount) + + >>> gl.processcount + {'pid_max': 0, 'running': 2, 'sleeping': 433, 'thread': 2372, 'total': 591} + >>> gl.processcount.keys() + ['total', 'running', 'sleeping', 'thread', 'pid_max'] + >>> gl.processcount["total"] + 591 + +Processcount fields description: + +* total: Total number of processes +* running: Total number of running processes +* sleeping: Total number of sleeping processes +* thread: Total number of threads +* pid_max: Maximum number of processes + +Processcount limits: + +.. code-block:: python + + >>> gl.processcount.limits + {'history_size': 1200.0, 'processcount_disable': ['False']} + +Glances gpu +----------- + +Gpu stats: + +.. code-block:: python + + >>> type(gl.gpu) + + >>> gl.gpu + [] + +Gpu fields description: + +* gpu_id: GPU identification +* name: GPU name +* mem: Memory consumption +* proc: GPU processor consumption +* temperature: GPU temperature +* fan_speed: GPU fan speed + +Gpu limits: + +.. code-block:: python + + >>> gl.gpu.limits + {'gpu_disable': ['False'], + 'gpu_mem_careful': 50.0, + 'gpu_mem_critical': 90.0, + 'gpu_mem_warning': 70.0, + 'gpu_proc_careful': 50.0, + 'gpu_proc_critical': 90.0, + 'gpu_proc_warning': 70.0, + 'gpu_temperature_careful': 60.0, + 'gpu_temperature_critical': 80.0, + 'gpu_temperature_warning': 70.0, + 'history_size': 1200.0} + +Glances percpu +-------------- + +Percpu stats: + +.. code-block:: python + + >>> type(gl.percpu) + + >>> gl.percpu + Return a dict of dict with key= + >>> gl.percpu.keys() + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + >>> gl.percpu["0"] + {'cpu_number': 0, + 'dpc': None, + 'guest': 0.0, + 'guest_nice': 0.0, + 'idle': 44.0, + 'interrupt': None, + 'iowait': 0.0, + 'irq': 0.0, + 'key': 'cpu_number', + 'nice': 0.0, + 'softirq': 0.0, + 'steal': 0.0, + 'system': 11.0, + 'total': 56.0, + 'user': 0.0} + +Percpu fields description: + +* cpu_number: CPU number +* total: Sum of CPU percentages (except idle) for current CPU number. +* system: Percent time spent in kernel space. System CPU time is the time spent running code in the Operating System kernel. +* user: CPU percent time spent in user space. User CPU time is the time spent on the processor running your program's code (or code in libraries). +* iowait: *(Linux)*: percent time spent by the CPU waiting for I/O operations to complete. +* idle: percent of CPU used by any program. Every program or task that runs on a computer system occupies a certain amount of processing time on the CPU. If the CPU has completed all tasks it is idle. +* irq: *(Linux and BSD)*: percent time spent servicing/handling hardware/software interrupts. Time servicing interrupts (hardware + software). +* nice: *(Unix)*: percent time occupied by user level processes with a positive nice value. The time the CPU has spent running users' processes that have been *niced*. +* steal: *(Linux)*: percentage of time a virtual CPU waits for a real CPU while the hypervisor is servicing another virtual processor. +* guest: *(Linux)*: percent of time spent running a virtual CPU for guest operating systems under the control of the Linux kernel. +* guest_nice: *(Linux)*: percent of time spent running a niced guest (virtual CPU). +* softirq: *(Linux)*: percent of time spent handling software interrupts. +* dpc: *(Windows)*: percent of time spent handling deferred procedure calls. +* interrupt: *(Windows)*: percent of time spent handling software interrupts. + +Percpu limits: + +.. code-block:: python + + >>> gl.percpu.limits + {'history_size': 1200.0, + 'percpu_disable': ['False'], + 'percpu_iowait_careful': 50.0, + 'percpu_iowait_critical': 90.0, + 'percpu_iowait_warning': 70.0, + 'percpu_max_cpu_display': 4.0, + 'percpu_system_careful': 50.0, + 'percpu_system_critical': 90.0, + 'percpu_system_warning': 70.0, + 'percpu_user_careful': 50.0, + 'percpu_user_critical': 90.0, + 'percpu_user_warning': 70.0} + +Glances system +-------------- + +System stats: + +.. code-block:: python + + >>> type(gl.system) + + >>> gl.system + {'hostname': 'nicolargo-xps15', + 'hr_name': 'Ubuntu 24.04 64bit / Linux 6.14.0-33-generic', + 'linux_distro': 'Ubuntu 24.04', + 'os_name': 'Linux', + 'os_version': '6.14.0-33-generic', + 'platform': '64bit'} + >>> gl.system.keys() + ['os_name', 'hostname', 'platform', 'os_version', 'linux_distro', 'hr_name'] + >>> gl.system["os_name"] + 'Linux' + +System fields description: + +* os_name: Operating system name +* hostname: Hostname +* platform: Platform (32 or 64 bits) +* linux_distro: Linux distribution +* os_version: Operating system version +* hr_name: Human readable operating system name + +System limits: + +.. code-block:: python + + >>> gl.system.limits + {'history_size': 1200.0, 'system_disable': ['False'], 'system_refresh': 60} + +Glances network +--------------- + +Network stats: + +.. code-block:: python + + >>> type(gl.network) + + >>> gl.network + Return a dict of dict with key= + >>> gl.network.keys() + ['wlp0s20f3', 'veth33b370c'] + >>> gl.network["wlp0s20f3"] + {'alias': None, + 'bytes_all': 0, + 'bytes_all_gauge': 9103063926, + 'bytes_all_rate_per_sec': 0.0, + 'bytes_recv': 0, + 'bytes_recv_gauge': 7354763622, + 'bytes_recv_rate_per_sec': 0.0, + 'bytes_sent': 0, + 'bytes_sent_gauge': 1748300304, + 'bytes_sent_rate_per_sec': 0.0, + 'interface_name': 'wlp0s20f3', + 'key': 'interface_name', + 'speed': 0, + 'time_since_update': 0.002886056900024414} + +Network fields description: + +* interface_name: Interface name. +* alias: Interface alias name (optional). +* bytes_recv: Number of bytes received. +* bytes_sent: Number of bytes sent. +* bytes_all: Number of bytes received and sent. +* speed: Maximum interface speed (in bit per second). Can return 0 on some operating-system. +* is_up: Is the interface up ? + +Network limits: + +.. code-block:: python + + >>> gl.network.limits + {'history_size': 1200.0, + 'network_disable': ['False'], + 'network_hide': ['docker.*', 'lo'], + 'network_hide_no_ip': ['True'], + 'network_hide_no_up': ['True'], + 'network_hide_zero': ['False'], + 'network_rx_careful': 70.0, + 'network_rx_critical': 90.0, + 'network_rx_warning': 80.0, + 'network_tx_careful': 70.0, + 'network_tx_critical': 90.0, + 'network_tx_warning': 80.0} + +Glances cpu +----------- + +Cpu stats: + +.. code-block:: python + + >>> type(gl.cpu) + + >>> gl.cpu + {'cpucore': 16, + 'ctx_switches': 1159163052, + 'guest': 0.0, + 'idle': 91.0, + 'interrupts': 948499511, + 'iowait': 0.6, + 'irq': 0.0, + 'nice': 0.0, + 'soft_interrupts': 405176594, + 'steal': 0.0, + 'syscalls': 0, + 'system': 4.9, + 'total': 6.9, + 'user': 3.4} + >>> gl.cpu.keys() + ['total', 'user', 'nice', 'system', 'idle', 'iowait', 'irq', 'steal', 'guest', 'ctx_switches', 'interrupts', 'soft_interrupts', 'syscalls', 'cpucore'] + >>> gl.cpu["total"] + 6.9 + +Cpu fields description: + +* total: Sum of all CPU percentages (except idle). +* system: Percent time spent in kernel space. System CPU time is the time spent running code in the Operating System kernel. +* user: CPU percent time spent in user space. User CPU time is the time spent on the processor running your program's code (or code in libraries). +* iowait: *(Linux)*: percent time spent by the CPU waiting for I/O operations to complete. +* dpc: *(Windows)*: time spent servicing deferred procedure calls (DPCs) +* idle: percent of CPU used by any program. Every program or task that runs on a computer system occupies a certain amount of processing time on the CPU. If the CPU has completed all tasks it is idle. +* irq: *(Linux and BSD)*: percent time spent servicing/handling hardware/software interrupts. Time servicing interrupts (hardware + software). +* nice: *(Unix)*: percent time occupied by user level processes with a positive nice value. The time the CPU has spent running users' processes that have been *niced*. +* steal: *(Linux)*: percentage of time a virtual CPU waits for a real CPU while the hypervisor is servicing another virtual processor. +* guest: *(Linux)*: time spent running a virtual CPU for guest operating systems under the control of the Linux kernel. +* ctx_switches: number of context switches (voluntary + involuntary) per second. A context switch is a procedure that a computer's CPU (central processing unit) follows to change from one task (or process) to another while ensuring that the tasks do not conflict. +* interrupts: number of interrupts per second. +* soft_interrupts: number of software interrupts per second. Always set to 0 on Windows and SunOS. +* syscalls: number of system calls per second. Always 0 on Linux OS. +* cpucore: Total number of CPU core. +* time_since_update: Number of seconds since last update. + +Cpu limits: + +.. code-block:: python + + >>> gl.cpu.limits + {'cpu_ctx_switches_careful': 640000.0, + 'cpu_ctx_switches_critical': 800000.0, + 'cpu_ctx_switches_warning': 720000.0, + 'cpu_disable': ['False'], + 'cpu_iowait_careful': 5.0, + 'cpu_iowait_critical': 6.25, + 'cpu_iowait_warning': 5.625, + 'cpu_steal_careful': 50.0, + 'cpu_steal_critical': 90.0, + 'cpu_steal_warning': 70.0, + 'cpu_system_careful': 50.0, + 'cpu_system_critical': 90.0, + 'cpu_system_log': ['False'], + 'cpu_system_warning': 70.0, + 'cpu_total_careful': 65.0, + 'cpu_total_critical': 85.0, + 'cpu_total_log': ['True'], + 'cpu_total_warning': 75.0, + 'cpu_user_careful': 50.0, + 'cpu_user_critical': 90.0, + 'cpu_user_log': ['False'], + 'cpu_user_warning': 70.0, + 'history_size': 1200.0} + +Glances amps +------------ + +Amps stats: + +.. code-block:: python + + >>> type(gl.amps) + + >>> gl.amps + Return a dict of dict with key= + >>> gl.amps.keys() + ['Dropbox', 'Python', 'Conntrack', 'Nginx', 'Systemd', 'SystemV'] + >>> gl.amps["Dropbox"] + {'count': 0, + 'countmax': None, + 'countmin': 1.0, + 'key': 'name', + 'name': 'Dropbox', + 'refresh': 3.0, + 'regex': True, + 'result': None, + 'timer': 0.32262086868286133} + +Amps fields description: + +* name: AMP name. +* result: AMP result (a string). +* refresh: AMP refresh interval. +* timer: Time until next refresh. +* count: Number of matching processes. +* countmin: Minimum number of matching processes. +* countmax: Maximum number of matching processes. + +Amps limits: + +.. code-block:: python + + >>> gl.amps.limits + {'amps_disable': ['False'], 'history_size': 1200.0} + +Glances processlist +------------------- + +Processlist stats: + +.. code-block:: python + + >>> type(gl.processlist) + + >>> gl.processlist + Return a dict of dict with key= + >>> gl.processlist.keys() + [1211585, 1209239, 1209523, 1316902, 1212589, 739161, 1224962, 1209604, 1225365, 1209611, 1412561, 1209619, 5654, 1209632, 464283, 1212999, 1209559, 1348985, 446730, 1348984, 1311079, 1287223, 739044, 614914, 1349000, 1318955, 1213613, 6237, 1349010, 739264, 18544, 1416830, 1349017, 1211584, 1209533, 1350217, 1212055, 61459, 1414500, 1415696, 1414804, 739199, 1382036, 1212053, 1212054, 1212802, 1351260, 6612, 1210327, 1212793, 3476, 1212316, 732, 6069, 1209509, 9513, 1416827, 739578, 569516, 739105, 1212051, 1209504, 6225, 6652, 5857, 2993, 5770, 5990, 6512, 8666, 1212056, 5782, 6624, 5267, 6253, 614544, 6126, 2719, 5811, 5808, 1, 688630, 5950, 1350197, 6285, 5589, 14301, 5762, 6647, 2627, 614742, 5421, 2620, 1287017, 5265, 6013, 9878, 5245, 2652, 5789, 5262, 2655, 5800, 6211, 2990, 5836, 5794, 2653, 5830, 2953, 3051, 5813, 5214, 3503, 5885, 688600, 5268, 5784, 2493, 234055, 5833, 1287018, 7197, 739047, 3556, 6192, 20411, 20420, 614737, 6023, 5795, 2720, 2838, 2841, 2647, 14320, 5335, 2623, 6076, 2642, 5575, 794, 5631, 2616, 6142, 5281, 5871, 5832, 5740, 6060, 5961, 6035, 6046, 614691, 483484, 2645, 5586, 5947, 6085, 5786, 5821, 2648, 2492, 5560, 2494, 5339, 3487, 5404, 5826, 408229, 6153, 5561, 1381449, 2615, 5646, 2634, 5263, 14326, 11442, 614728, 739046, 614678, 2791, 1350169, 1350176, 6438, 2614, 2491, 1211852, 614677, 3670, 6654, 2619, 1209336, 14329, 2873, 1416821, 3500, 2874, 3489, 3526, 5252, 5346, 1412114, 3191, 3495, 1416826, 1286689, 3490, 1286685, 2875, 739062, 2718, 1287044, 3192, 1211841, 2, 3, 4, 5, 6, 7, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 77, 78, 79, 80, 81, 83, 84, 85, 86, 87, 89, 90, 91, 92, 93, 95, 96, 97, 98, 99, 101, 102, 103, 104, 105, 107, 108, 109, 110, 111, 113, 114, 115, 116, 117, 118, 121, 122, 123, 124, 125, 126, 127, 128, 134, 135, 136, 137, 138, 139, 140, 142, 145, 146, 147, 148, 149, 150, 152, 155, 156, 157, 158, 165, 176, 185, 186, 211, 233, 262, 263, 264, 265, 271, 274, 275, 276, 277, 278, 279, 356, 359, 361, 362, 363, 364, 365, 452, 453, 616, 621, 622, 623, 629, 664, 665, 766, 767, 801, 977, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1039, 1240, 1241, 1256, 1266, 1267, 1268, 1269, 1270, 1271, 1331, 1334, 1475, 1481, 1892, 1893, 1894, 1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902, 1903, 1904, 1905, 1934, 1935, 1936, 1938, 1939, 1940, 1941, 1943, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 2027, 2043, 2044, 2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 2053, 2054, 2055, 2056, 2058, 2059, 2060, 2061, 2062, 2063, 2064, 2066, 2068, 3390, 3522, 3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, 3948, 5125, 5134, 14316, 88766, 88767, 88768, 88769, 1347821, 1367851, 1376378, 1379781, 1381156, 1381183, 1381193, 1381200, 1381818, 1383934, 1392881, 1393978, 1394352, 1395218, 1396940, 1397281, 1397419, 1398096, 1398753, 1399178, 1400256, 1400825, 1401161, 1403285, 1404176, 1404177, 1404178, 1404179, 1405068, 1405097, 1408038, 1408119, 1408414, 1409839, 1410062, 1410063, 1410064, 1410150, 1410206, 1411012, 1411105, 1412785, 1413033, 1413034, 1413157, 1413320, 1413352, 1413561, 1413929, 1414017, 1414156, 1414306, 1414696, 1414910, 1414911, 1415007, 1415327, 1415678, 1415951, 1416012, 1416216, 1416798, 1416801, 1416802, 1416856] + >>> gl.processlist["1211585"] + {'cmdline': ['/proc/self/exe', + '--type=utility', + '--utility-sub-type=node.mojom.NodeService', + '--lang=en-US', + '--service-sandbox-type=none', + '--no-sandbox', + '--dns-result-order=ipv4first', + '--experimental-network-inspection', + '--inspect-port=0', + '--crashpad-handler-pid=739062', + '--enable-crash-reporter=864d4bb7-dd20-4851-830f-29e81dd93517,no_channel', + '--user-data-dir=/home/nicolargo/.config/Code', + '--standard-schemes=vscode-webview,vscode-file', + '--secure-schemes=vscode-webview,vscode-file', + '--cors-schemes=vscode-webview,vscode-file', + '--fetch-schemes=vscode-webview,vscode-file', + '--service-worker-schemes=vscode-webview', + '--code-cache-schemes=vscode-webview,vscode-file', + '--shared-files=v8_context_snapshot_data:100', + '--field-trial-handle=3,i,16476947824719290197,4720072013320928602,262144', + '--enable-features=DocumentPolicyIncludeJSCallStacksInCrashReports,EarlyEstablishGpuChannel,EstablishGpuChannelAsync', + '--disable-features=CalculateNativeWinOcclusion,FontationsLinuxSystemFonts,ScreenAIOCREnabled,SpareRendererForSitePerProcess', + '--variations-seed-version'], + 'cpu_percent': 3.2, + 'cpu_times': {'children_system': 484.63, + 'children_user': 253.75, + 'iowait': 0.0, + 'system': 445.44, + 'user': 3483.93}, + 'gids': {'effective': 1000, 'real': 1000, 'saved': 1000}, + 'io_counters': [871562240, + 936493056, + 871562240, + 936493056, + 1, + 150896640, + 1785856, + 150896640, + 1785856, + 1, + 265695232, + 434176, + 265695232, + 434176, + 1, + 189501440, + 0, + 189501440, + 0, + 1, + 6549504, + 8192, + 6549504, + 8192, + 1, + 2169856, + 8192, + 2169856, + 8192, + 1, + 37666816, + 1306624, + 37666816, + 1306624, + 1, + 820237312, + 1112899584, + 820237312, + 1112899584, + 1, + 5561344, + 0, + 5561344, + 0, + 1, + 9895936, + 0, + 9895936, + 0, + 1, + 8621056, + 5234688, + 8621056, + 5234688, + 1, + 92611584, + 928796672, + 92611584, + 928796672, + 1, + 12394496, + 0, + 12394496, + 0, + 1, + 46157824, + 0, + 46157824, + 0, + 1, + 14960640, + 0, + 14960640, + 0, + 1, + 3081216, + 0, + 3081216, + 0, + 1, + 15736832, + 0, + 15736832, + 0, + 1, + 8032256, + 0, + 8032256, + 0, + 1, + 13874176, + 77824, + 13874176, + 77824, + 1, + 43543552, + 26492928, + 43543552, + 26492928, + 1, + 1704960, + 36864, + 1704960, + 36864, + 1, + 194560, + 0, + 194560, + 0, + 1], + 'key': 'pid', + 'memory_info': {'data': 4808552448, + 'dirty': 0, + 'lib': 0, + 'rss': 2209136640, + 'shared': 74182656, + 'text': 148733952, + 'vms': 1526384463872}, + 'memory_percent': 13.451586111949402, + 'name': 'code', + 'nice': 0, + 'num_threads': 62, + 'pid': 1211585, + 'status': 'S', + 'time_since_update': 0.6123301982879639, + 'username': 'nicolargo'} + +Processlist fields description: + +* pid: Process identifier (ID) +* name: Process name +* cmdline: Command line with arguments +* username: Process owner +* num_threads: Number of threads +* cpu_percent: Process CPU consumption (returned value can be > 100.0 in case of a process running multiple threads on different CPU cores) +* memory_percent: Process memory consumption +* memory_info: Process memory information (dict with rss, vms, shared, text, lib, data, dirty keys) +* status: Process status +* nice: Process nice value +* cpu_times: Process CPU times (dict with user, system, iowait keys) +* gids: Process group IDs (dict with real, effective, saved keys) +* io_counters: Process IO counters (list with read_count, write_count, read_bytes, write_bytes, io_tag keys) + +Processlist limits: + +.. code-block:: python + + >>> gl.processlist.limits + {'history_size': 1200.0, + 'processlist_cpu_careful': 50.0, + 'processlist_cpu_critical': 90.0, + 'processlist_cpu_warning': 70.0, + 'processlist_disable': ['False'], + 'processlist_mem_careful': 50.0, + 'processlist_mem_critical': 90.0, + 'processlist_mem_warning': 70.0, + 'processlist_nice_warning': ['-20', + '-19', + '-18', + '-17', + '-16', + '-15', + '-14', + '-13', + '-12', + '-11', + '-10', + '-9', + '-8', + '-7', + '-6', + '-5', + '-4', + '-3', + '-2', + '-1', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + '10', + '11', + '12', + '13', + '14', + '15', + '16', + '17', + '18', + '19'], + 'processlist_status_critical': ['Z', 'D'], + 'processlist_status_ok': ['R', 'W', 'P', 'I']} + +Glances load +------------ + +Load stats: + +.. code-block:: python + + >>> type(gl.load) + + >>> gl.load + {'cpucore': 16, + 'min1': 1.06591796875, + 'min15': 1.193359375, + 'min5': 1.2529296875} + >>> gl.load.keys() + ['min1', 'min5', 'min15', 'cpucore'] + >>> gl.load["min1"] + 1.06591796875 + +Load fields description: + +* min1: Average sum of the number of processes waiting in the run-queue plus the number currently executing over 1 minute. +* min5: Average sum of the number of processes waiting in the run-queue plus the number currently executing over 5 minutes. +* min15: Average sum of the number of processes waiting in the run-queue plus the number currently executing over 15 minutes. +* cpucore: Total number of CPU core. + +Load limits: + +.. code-block:: python + + >>> gl.load.limits + {'history_size': 1200.0, + 'load_careful': 0.7, + 'load_critical': 5.0, + 'load_disable': ['False'], + 'load_warning': 1.0} + +Glances sensors +--------------- + +Sensors stats: + +.. code-block:: python + + >>> type(gl.sensors) + + >>> gl.sensors + Return a dict of dict with key=