diff --git a/docs/api/python.rst b/docs/api/python.rst index c1c122b8..ccd62bd4 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': 1518002862, + 'ctx_switches': 48524581, 'guest': 0.0, - 'idle': 87.3, - 'interrupts': 1219803032, - 'iowait': 4.9, + 'idle': 92.8, + 'interrupts': 47218481, + 'iowait': 0.4, 'irq': 0.0, 'nice': 0.0, - 'soft_interrupts': 529891210, + 'soft_interrupts': 18174300, 'steal': 0.0, 'syscalls': 0, - 'system': 4.9, - 'total': 7.2, - 'user': 2.6} + 'system': 4.3, + 'total': 8.2, + 'user': 2.5} >>> gl.cpu["total"] - 7.2 + 8.2 >>> gl.mem["used"] - 11703642752 + 12597943576 >>> gl.auto_unit(gl.mem["used"]) - 10.9G + 11.7G If the stats return a list of items (like network interfaces or processes), you can access them by their name: @@ -48,1724 +48,22 @@ access them by their name: .. code-block:: python >>> gl.network.keys() - ['wlp0s20f3', 'veth33b370c', 'veth19c7711'] - >>> gl.network["wlp0s20f3"] - {'alias': None, - 'bytes_all': 0, - 'bytes_all_gauge': 13043546419, - 'bytes_all_rate_per_sec': 0.0, - 'bytes_recv': 0, - 'bytes_recv_gauge': 10650063359, - 'bytes_recv_rate_per_sec': 0.0, - 'bytes_sent': 0, - 'bytes_sent_gauge': 2393483060, - 'bytes_sent_rate_per_sec': 0.0, - 'interface_name': 'wlp0s20f3', - 'key': 'interface_name', - 'speed': 0, - 'time_since_update': 0.17118191719055176} - -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': 91.73630880003815, - 'begin': 1762177541, - 'count': 2, - 'desc': '', - 'end': -1, - 'global_msg': 'High swap (paging) usage', - 'max': 91.73630880003815, - 'min': 91.73630880003815, - 'sort': 'memory_percent', - 'state': 'CRITICAL', - 'sum': 183.4726176000763, - 'top': ['code', 'code', 'WebExtensions'], - 'type': 'MEMSWAP'}, - {'avg': 71.24125901922687, - 'begin': 1762177541, - 'count': 2, - 'desc': '', - 'end': -1, - 'global_msg': 'High swap (paging) usage', - 'max': 71.26429187377946, - 'min': 71.2182261646743, - 'sort': 'memory_percent', - 'state': 'WARNING', - 'sum': 142.48251803845375, - '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.006312, - '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': 49126157824, - 'read_count': 2826082, - 'read_latency': 0, - 'read_time': 1021898, - 'write_bytes': 97262511104, - 'write_count': 8791103, - 'write_latency': 0, - 'write_time': 8005720} - -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() - ['homeassistant', 'timescaledb-for-glances', 'prometheus-for-glances'] - >>> gl.containers["homeassistant"] - {'command': '/init', - 'cpu': {'total': 0.0}, - 'cpu_percent': 0.0, - 'created': '2025-11-03T09:43:31.02993333Z', - 'engine': 'docker', - 'id': '3bf16da8d0ac1690a7a9fba938ef52d338a9e8db00a8fcba8f707d87e4886471', - 'image': ('ghcr.io/home-assistant/home-assistant:stable',), - 'io': {}, - 'io_rx': None, - 'io_wx': None, - 'key': 'name', - 'memory': {}, - 'memory_inactive_file': None, - 'memory_limit': None, - 'memory_percent': None, - 'memory_usage': None, - 'name': 'homeassistant', - 'network': {}, - 'network_rx': None, - 'network_tx': None, - 'ports': '', - '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': 450, 'thread': 2474, 'total': 604} - >>> gl.processcount.keys() - ['total', 'running', 'sleeping', 'thread', 'pid_max'] - >>> gl.processcount["total"] - 604 - -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': 25.0, - 'interrupt': None, - 'iowait': 0.0, - 'irq': 0.0, - 'key': 'cpu_number', - 'nice': 0.0, - 'softirq': 0.0, - 'steal': 0.0, - 'system': 7.0, - 'total': 75.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', 'veth19c7711'] - >>> gl.network["wlp0s20f3"] - {'alias': None, - 'bytes_all': 0, - 'bytes_all_gauge': 13043546419, - 'bytes_all_rate_per_sec': 0.0, - 'bytes_recv': 0, - 'bytes_recv_gauge': 10650063359, - 'bytes_recv_rate_per_sec': 0.0, - 'bytes_sent': 0, - 'bytes_sent_gauge': 2393483060, - 'bytes_sent_rate_per_sec': 0.0, - 'interface_name': 'wlp0s20f3', - 'key': 'interface_name', - 'speed': 0, - 'time_since_update': 0.004456996917724609} - -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': 1518002862, - 'guest': 0.0, - 'idle': 87.3, - 'interrupts': 1219803032, - 'iowait': 4.9, - 'irq': 0.0, - 'nice': 0.0, - 'soft_interrupts': 529891210, - 'steal': 0.0, - 'syscalls': 0, - 'system': 4.9, - 'total': 7.2, - 'user': 2.6} - >>> gl.cpu.keys() - ['total', 'user', 'nice', 'system', 'idle', 'iowait', 'irq', 'steal', 'guest', 'ctx_switches', 'interrupts', 'soft_interrupts', 'syscalls', 'cpucore'] - >>> gl.cpu["total"] - 7.2 - -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.21608233451843262} - -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() - [1608782, 1609441, 1209523, 1209239, 1209604, 1316902, 1608672, 1610135, 1631694, 1676423, 1674764, 5654, 1209619, 1224962, 1695841, 1510111, 1508741, 1209559, 1209632, 6237, 1608552, 1209611, 1608710, 464283, 1610173, 1608754, 1667892, 446730, 1287223, 1511132, 1608755, 61459, 1610075, 1608850, 1847031, 1493680, 1609327, 1609756, 1609114, 1842326, 1842637, 1844409, 1608634, 1780895, 3476, 1493854, 732, 1609326, 1609325, 6612, 1318955, 1608555, 18544, 1350217, 1608554, 1847028, 6069, 1209533, 569516, 1493855, 9513, 2993, 1738682, 6652, 1738626, 6225, 1212793, 1210327, 1609328, 1676656, 1609323, 1493857, 1494015, 5267, 1493861, 5990, 1209509, 1676307, 5782, 2627, 6253, 1, 5857, 5770, 8666, 5762, 5245, 1209504, 7197, 14301, 6624, 2719, 9878, 2953, 5811, 5950, 6647, 1493658, 6285, 1350197, 2652, 5808, 5262, 5265, 5214, 6126, 5268, 6211, 1808423, 5885, 2720, 794, 1684044, 5830, 6512, 2990, 5784, 5589, 3051, 688630, 2838, 5281, 2616, 6013, 5795, 5836, 1841210, 5813, 5800, 5789, 1738862, 5871, 6192, 2493, 5421, 5833, 3556, 1752388, 2620, 20411, 3503, 234055, 2623, 6046, 2642, 688600, 2647, 5794, 1618848, 5740, 5631, 20420, 5335, 6085, 2645, 2841, 6142, 6060, 5786, 6035, 6153, 5832, 6023, 2655, 5404, 5821, 6076, 2494, 5826, 5961, 14320, 2615, 5575, 5947, 5339, 2648, 5586, 2492, 5560, 2653, 1493859, 3487, 1609124, 1493858, 1609104, 5561, 2791, 5646, 5263, 14326, 11442, 1608570, 2491, 1493860, 2614, 2634, 3670, 1287017, 6654, 1847022, 2873, 14329, 1493635, 1350169, 1350176, 3500, 3489, 1493629, 2619, 3526, 1287018, 5252, 5346, 3191, 3495, 1846975, 1847027, 3490, 6438, 2875, 2874, 2718, 1209336, 3192, 1286685, 1287044, 1286689, 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, 1618529, 1672035, 1676328, 1676372, 1676373, 1676381, 1676382, 1676390, 1676421, 1676695, 1695966, 1739564, 1762314, 1765022, 1765031, 1766341, 1769332, 1773891, 1775198, 1777553, 1779262, 1783879, 1785824, 1788838, 1799362, 1812136, 1812949, 1816976, 1816978, 1817743, 1818881, 1820441, 1821518, 1823557, 1824294, 1824766, 1824903, 1825104, 1825105, 1825106, 1825905, 1829478, 1830007, 1830009, 1830010, 1830011, 1830076, 1830203, 1831108, 1833543, 1835610, 1836406, 1836769, 1837379, 1838742, 1839897, 1840079, 1840080, 1841400, 1841723, 1841892, 1842308, 1842436, 1843013, 1844698, 1845442, 1846507] - >>> gl.processlist["1608782"] - {'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=1608570', - '--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,9883300921707787016,857782282863154824,262144', - '--enable-features=DocumentPolicyIncludeJSCallStacksInCrashReports,EarlyEstablishGpuChannel,EstablishGpuChannelAsync', - '--disable-features=CalculateNativeWinOcclusion,FontationsLinuxSystemFonts,ScreenAIOCREnabled,SpareRendererForSitePerProcess', - '--variations-seed-version'], - 'cpu_percent': 11.8, - 'cpu_times': {'children_system': 383.51, - 'children_user': 155.82, - 'iowait': 0.0, - 'system': 383.07, - 'user': 1136.82}, - 'gids': {'effective': 1000, 'real': 1000, 'saved': 1000}, - 'io_counters': [895778816, - 522051584, - 895778816, - 521465856, - 1, - 155616256, - 225280, - 155616256, - 225280, - 1, - 103347200, - 253952, - 103347200, - 253952, - 1, - 158570496, - 45010944, - 158570496, - 45010944, - 1, - 12946432, - 0, - 12946432, - 0, - 1, - 92551168, - 0, - 92551168, - 0, - 1, - 13459456, - 1138688, - 13459456, - 1138688, - 1, - 11345920, - 0, - 11345920, - 0, - 1, - 36054016, - 0, - 36054016, - 0, - 1, - 15905792, - 0, - 15905792, - 0, - 1, - 12955648, - 4096, - 12955648, - 4096, - 1, - 7147520, - 0, - 7147520, - 0, - 1, - 4421632, - 0, - 4421632, - 0, - 1, - 6177792, - 5541888, - 6177792, - 5541888, - 1, - 1113088, - 0, - 1113088, - 0, - 1, - 1512448, - 0, - 1512448, - 0, - 1, - 15822848, - 0, - 15822848, - 0, - 1], - 'key': 'pid', - 'memory_info': {'data': 4407611392, - 'dirty': 0, - 'lib': 0, - 'rss': 1914802176, - 'shared': 94371840, - 'text': 148733952, - 'vms': 1526362460160}, - 'memory_percent': 11.659363160900762, - 'name': 'code', - 'nice': 0, - 'num_threads': 61, - 'pid': 1608782, - 'status': 'R', - 'time_since_update': 0.4391207695007324, - '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': 2.22509765625, - 'min15': 1.1025390625, - 'min5': 1.40966796875} - >>> gl.load.keys() - ['min1', 'min5', 'min15', 'cpucore'] - >>> gl.load["min1"] - 2.22509765625 - -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=