From c6a48bf424562e8f3b381af9ed73422c44e04413 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sat, 5 Jul 2025 10:19:59 +0200 Subject: [PATCH] Update docs and correct an issue with UTC import --- AUTHORS | 3 + README.rst | 294 +-- docs/_static/glances-cgraph.svg | 2337 +++++++++++------------- docs/_static/glances-flame.svg | 4 +- docs/_static/glances-pyinstrument.html | 10 +- docs/api.rst | 693 ++++--- docs/man/glances.1 | 2 +- glances/attribute.py | 10 +- tests/test_core.py | 10 +- 9 files changed, 1605 insertions(+), 1758 deletions(-) diff --git a/AUTHORS b/AUTHORS index c1609cc1..be1fc117 100644 --- a/AUTHORS +++ b/AUTHORS @@ -13,6 +13,9 @@ PGP Public key: gpg --keyserver pgp.mit.edu --recv-keys 0xba43c11f2c8b4347 RazCrimson (maintainer of the Glances project) https://github.com/RazCrimson +Ariel Otibili (aka) ariel-anieli (for the huge work on code quality) +https://github.com/ariel-anieli + Alessio Sergi (aka) Al3hex (thanks you for the great job on this project) https://twitter.com/al3hex https://github.com/asergi diff --git a/README.rst b/README.rst index 25f7d7b4..376ff930 100644 --- a/README.rst +++ b/README.rst @@ -71,71 +71,106 @@ Glances is written in Python and uses libraries to grab information from your system. It is based on an open architecture where developers can add new plugins or exports modules. -Project sponsorship -=================== +Usage +===== -You can help me to achieve my goals of improving this open-source project -or just say "thank you" by: +For the standalone mode, just run: -- sponsor me using one-time or monthly tier Github sponsors_ page -- send me some pieces of bitcoin: 185KN9FCix3svJYp7JQM7hRMfSKyeaJR4X -- buy me a gift on my wishlist_ page +.. code-block:: console -Any and all contributions are greatly appreciated. + $ glances -Requirements -============ +For the Web server mode, run: -Glances is developed in Python. A minimal Python version 3.9 or higher -should be installed on your system. +.. code-block:: console -*Note for Python 2 users* + $ glances -w -Glances version 4 or higher do not support Python 2 (and Python 3 < 3.9). -Please uses Glances version 3.4.x if you need Python 2 support. +and enter the URL ``http://:61208`` in your favorite web browser. -Dependencies: +For the client/server mode, run: -- ``psutil`` (better with latest version) -- ``defusedxml`` (in order to monkey patch xmlrpc) -- ``packaging`` (for the version comparison) -- ``windows-curses`` (Windows Curses implementation) [Windows-only] -- ``shtab`` (Shell autocompletion) [All but Windows] +.. code-block:: console -Optional dependencies: + $ glances -s -- ``batinfo`` (for battery monitoring) -- ``bernhard`` (for the Riemann export module) -- ``cassandra-driver`` (for the Cassandra export module) -- ``chevron`` (for the action script feature) -- ``docker`` (for the Containers Docker monitoring support) -- ``elasticsearch`` (for the Elastic Search export module) -- ``FastAPI`` and ``Uvicorn`` (for Web server mode) -- ``graphitesender`` (For the Graphite export module) -- ``hddtemp`` (for HDD temperature monitoring support) [Linux-only] -- ``influxdb`` (for the InfluxDB version 1 export module) -- ``influxdb-client`` (for the InfluxDB version 2 export module) -- ``jinja2`` (for templating, used under the hood by FastAPI) -- ``kafka-python`` (for the Kafka export module) -- ``netifaces2`` (for the IP plugin) -- ``nvidia-ml-py`` (for the GPU plugin) -- ``pycouchdb`` (for the CouchDB export module) -- ``pika`` (for the RabbitMQ/ActiveMQ export module) -- ``podman`` (for the Containers Podman monitoring support) -- ``potsdb`` (for the OpenTSDB export module) -- ``prometheus_client`` (for the Prometheus export module) -- ``psycopg[binary]`` (for the PostgreSQL/TimeScale export module) -- ``pygal`` (for the graph export module) -- ``pymdstat`` (for RAID support) [Linux-only] -- ``pymongo`` (for the MongoDB export module) -- ``pysnmp-lextudio`` (for SNMP support) -- ``pySMART.smartx`` (for HDD Smart support) [Linux-only] -- ``pyzmq`` (for the ZeroMQ export module) -- ``requests`` (for the Ports, Cloud plugins and RESTful export module) -- ``sparklines`` (for the Quick Plugin sparklines option) -- ``statsd`` (for the StatsD export module) -- ``wifi`` (for the wifi plugin) [Linux-only] -- ``zeroconf`` (for the autodiscover mode) +on the server side and run: + +.. code-block:: console + + $ glances -c + +on the client one. + +You can also detect and display all Glances servers available on your +network or defined in the configuration file: + +.. code-block:: console + + $ glances --browser + +You can also display raw stats on stdout: + +.. code-block:: console + + $ glances --stdout cpu.user,mem.used,load + cpu.user: 30.7 + mem.used: 3278204928 + load: {'cpucore': 4, 'min1': 0.21, 'min5': 0.4, 'min15': 0.27} + cpu.user: 3.4 + mem.used: 3275251712 + load: {'cpucore': 4, 'min1': 0.19, 'min5': 0.39, 'min15': 0.27} + ... + +or in a CSV format thanks to the stdout-csv option: + +.. code-block:: console + + $ glances --stdout-csv now,cpu.user,mem.used,load + now,cpu.user,mem.used,load.cpucore,load.min1,load.min5,load.min15 + 2018-12-08 22:04:20 CEST,7.3,5948149760,4,1.04,0.99,1.04 + 2018-12-08 22:04:23 CEST,5.4,5949136896,4,1.04,0.99,1.04 + ... + +or in a JSON format thanks to the stdout-json option (attribute not supported in this mode in order to have a real JSON object in output): + +.. code-block:: console + + $ glances --stdout-json cpu,mem + cpu: {"total": 29.0, "user": 24.7, "nice": 0.0, "system": 3.8, "idle": 71.4, "iowait": 0.0, "irq": 0.0, "softirq": 0.0, "steal": 0.0, "guest": 0.0, "guest_nice": 0.0, "time_since_update": 1, "cpucore": 4, "ctx_switches": 0, "interrupts": 0, "soft_interrupts": 0, "syscalls": 0} + mem: {"total": 7837949952, "available": 2919079936, "percent": 62.8, "used": 4918870016, "free": 2919079936, "active": 2841214976, "inactive": 3340550144, "buffers": 546799616, "cached": 3068141568, "shared": 788156416} + ... + +and RTFM, always. + +Documentation +============= + +For complete documentation have a look at the readthedocs_ website. + +If you have any question (after RTFM!), please post it on the official Q&A `forum`_. + +Gateway to other services +========================= + +Glances can export stats to: + +- ``CSV`` file +- ``JSON`` file +- ``InfluxDB`` server +- ``Cassandra`` server +- ``CouchDB`` server +- ``OpenTSDB`` server +- ``Prometheus`` server +- ``StatsD`` server +- ``ElasticSearch`` server +- ``PostgreSQL/TimeScale`` server +- ``RabbitMQ/ActiveMQ`` broker +- ``ZeroMQ`` broker +- ``Kafka`` broker +- ``Riemann`` server +- ``Graphite`` server +- ``RESTful`` endpoint Installation ============ @@ -421,106 +456,59 @@ For example, on a Linux operating system with bash shell: Following shells are supported: bash, zsh and tcsh. -Usage -===== +Requirements +============ -For the standalone mode, just run: +Glances is developed in Python. A minimal Python version 3.9 or higher +should be installed on your system. -.. code-block:: console +*Note for Python 2 users* - $ glances +Glances version 4 or higher do not support Python 2 (and Python 3 < 3.9). +Please uses Glances version 3.4.x if you need Python 2 support. -For the Web server mode, run: +Dependencies: -.. code-block:: console +- ``psutil`` (better with latest version) +- ``defusedxml`` (in order to monkey patch xmlrpc) +- ``packaging`` (for the version comparison) +- ``windows-curses`` (Windows Curses implementation) [Windows-only] +- ``shtab`` (Shell autocompletion) [All but Windows] - $ glances -w +Optional dependencies: -and enter the URL ``http://:61208`` in your favorite web browser. - -For the client/server mode, run: - -.. code-block:: console - - $ glances -s - -on the server side and run: - -.. code-block:: console - - $ glances -c - -on the client one. - -You can also detect and display all Glances servers available on your -network or defined in the configuration file: - -.. code-block:: console - - $ glances --browser - -You can also display raw stats on stdout: - -.. code-block:: console - - $ glances --stdout cpu.user,mem.used,load - cpu.user: 30.7 - mem.used: 3278204928 - load: {'cpucore': 4, 'min1': 0.21, 'min5': 0.4, 'min15': 0.27} - cpu.user: 3.4 - mem.used: 3275251712 - load: {'cpucore': 4, 'min1': 0.19, 'min5': 0.39, 'min15': 0.27} - ... - -or in a CSV format thanks to the stdout-csv option: - -.. code-block:: console - - $ glances --stdout-csv now,cpu.user,mem.used,load - now,cpu.user,mem.used,load.cpucore,load.min1,load.min5,load.min15 - 2018-12-08 22:04:20 CEST,7.3,5948149760,4,1.04,0.99,1.04 - 2018-12-08 22:04:23 CEST,5.4,5949136896,4,1.04,0.99,1.04 - ... - -or in a JSON format thanks to the stdout-json option (attribute not supported in this mode in order to have a real JSON object in output): - -.. code-block:: console - - $ glances --stdout-json cpu,mem - cpu: {"total": 29.0, "user": 24.7, "nice": 0.0, "system": 3.8, "idle": 71.4, "iowait": 0.0, "irq": 0.0, "softirq": 0.0, "steal": 0.0, "guest": 0.0, "guest_nice": 0.0, "time_since_update": 1, "cpucore": 4, "ctx_switches": 0, "interrupts": 0, "soft_interrupts": 0, "syscalls": 0} - mem: {"total": 7837949952, "available": 2919079936, "percent": 62.8, "used": 4918870016, "free": 2919079936, "active": 2841214976, "inactive": 3340550144, "buffers": 546799616, "cached": 3068141568, "shared": 788156416} - ... - -and RTFM, always. - -Documentation -============= - -For complete documentation have a look at the readthedocs_ website. - -If you have any question (after RTFM!), please post it on the official Q&A `forum`_. - -Gateway to other services -========================= - -Glances can export stats to: - -- ``CSV`` file -- ``JSON`` file -- ``InfluxDB`` server -- ``Cassandra`` server -- ``CouchDB`` server -- ``OpenTSDB`` server -- ``Prometheus`` server -- ``StatsD`` server -- ``ElasticSearch`` server -- ``PostgreSQL/TimeScale`` server -- ``RabbitMQ/ActiveMQ`` broker -- ``ZeroMQ`` broker -- ``Kafka`` broker -- ``Riemann`` server -- ``Graphite`` server -- ``RESTful`` endpoint +- ``batinfo`` (for battery monitoring) +- ``bernhard`` (for the Riemann export module) +- ``cassandra-driver`` (for the Cassandra export module) +- ``chevron`` (for the action script feature) +- ``docker`` (for the Containers Docker monitoring support) +- ``elasticsearch`` (for the Elastic Search export module) +- ``FastAPI`` and ``Uvicorn`` (for Web server mode) +- ``graphitesender`` (For the Graphite export module) +- ``hddtemp`` (for HDD temperature monitoring support) [Linux-only] +- ``influxdb`` (for the InfluxDB version 1 export module) +- ``influxdb-client`` (for the InfluxDB version 2 export module) +- ``jinja2`` (for templating, used under the hood by FastAPI) +- ``kafka-python`` (for the Kafka export module) +- ``netifaces2`` (for the IP plugin) +- ``nvidia-ml-py`` (for the GPU plugin) +- ``pycouchdb`` (for the CouchDB export module) +- ``pika`` (for the RabbitMQ/ActiveMQ export module) +- ``podman`` (for the Containers Podman monitoring support) +- ``potsdb`` (for the OpenTSDB export module) +- ``prometheus_client`` (for the Prometheus export module) +- ``psycopg[binary]`` (for the PostgreSQL/TimeScale export module) +- ``pygal`` (for the graph export module) +- ``pymdstat`` (for RAID support) [Linux-only] +- ``pymongo`` (for the MongoDB export module) +- ``pysnmp-lextudio`` (for SNMP support) +- ``pySMART.smartx`` (for HDD Smart support) [Linux-only] +- ``pyzmq`` (for the ZeroMQ export module) +- ``requests`` (for the Ports, Cloud plugins and RESTful export module) +- ``sparklines`` (for the Quick Plugin sparklines option) +- ``statsd`` (for the StatsD export module) +- ``wifi`` (for the wifi plugin) [Linux-only] +- ``zeroconf`` (for the autodiscover mode) How to contribute ? =================== @@ -532,6 +520,18 @@ There is also a chat dedicated to the Glances developers: .. image:: https://badges.gitter.im/Join%20Chat.svg :target: https://gitter.im/nicolargo/glances?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge +Project sponsorship +=================== + +You can help me to achieve my goals of improving this open-source project +or just say "thank you" by: + +- sponsor me using one-time or monthly tier Github sponsors_ page +- send me some pieces of bitcoin: 185KN9FCix3svJYp7JQM7hRMfSKyeaJR4X +- buy me a gift on my wishlist_ page + +Any and all contributions are greatly appreciated. + Author ====== diff --git a/docs/_static/glances-cgraph.svg b/docs/_static/glances-cgraph.svg index d1735d9d..d777f3bf 100644 --- a/docs/_static/glances-cgraph.svg +++ b/docs/_static/glances-cgraph.svg @@ -4,1384 +4,1215 @@ - - + + %3 - - + + + + + -26 - - -model:1121:wrapper -10.40% -(0.01%) -684× +12 + + +__init__:539:as_dict +4.04% +(0.24%) +16834× - + -2393 - - -glances_curses:275:__catch_key -88.72% -(0.01%) -538× +62 + + +_common:452:wrapper +1.69% +(0.13%) +171242× - + -26->2393 - - -2.13% -14× +12->62 + + +0.24% +29002× - - -3464 - - -glances_curses:244:get_key -88.71% -(0.00%) -538× + + +2491 + + +__init__:1102:cpu_times +1.06% +(0.01%) +16832× - - -2393->3464 - - -0.76% - + + +62->2491 + + +0.23% +14501× - + -30 - - -subprocess:2062:_communicate -5.34% -(0.00%) -34× +15 + + +processes:557:update +4.29% +(0.02%) +29× + + +17 + + +__init__:524:msg_curse +1.56% +(0.03%) +60× + + + + + +253 + + +__init__:488:get_process_curses_data +1.55% +(0.54%) +30834× + + + + + +17->253 + + +0.38% +7643× + + + +19 + + +__init__:123:__get_sensor_data +1.50% +(0.00%) +40× + + + + + +44 + + +_common:812:bcat +1.67% +(0.03%) +42601× + + + + + +19->44 + + +0.53% +218× + + + +866 + + +_common:795:cat +1.66% +(0.06%) +43525× + + + + + +44->866 + + +0.19% +2490× + + + +20 + + +thread:53:run +1.50% +(0.00%) +40× + + + + + +21 + + +__init__:77:update +4.29% +(0.00%) +29× + + + + + +22 + + +json_stream:9:stream_as_text +50.19% +(0.00%) +64× + + + + + +24 + + +api:14:request +2.65% +(0.00%) + + + + + + +36 + + +_pslinux:1642:wrapper +3.68% +(0.24%) +298198× + + + + + +36->62 + + +0.12% +26615× + + + +37 + + +glances_curses:1099:update +15.92% +(0.01%) +30× + + + + + +2568 + + +glances_curses:274:__catch_key +100.00% +(0.01%) +555× + + + + + +37->2568 + + +0.53% + + + + +2571 + + +glances_curses:1085:flush +1.62% +(0.03%) +30× + + + + + +37->2571 + + +0.40% + + + + +2111 + + +glances_curses:249:get_key +99.98% +(0.01%) +555× + + + + + +2568->2111 + + +0.53% + + + + +2110 + + +glances_curses:510:display +1.60% +(0.00%) +30× + + + + + +2571->2110 + + +0.40% + + + + +38 + + +client:1082:_send_output +2.65% +(0.00%) +125× + + + + + +39 + + +model:1137:wrapper +6.69% +(0.01%) +653× + + + + + +39->2568 + + +0.89% + + + + +40 + + +response:864:_raw_read +49.93% +(0.00%) +130× + + + + + +40->2568 + + +0.71% + + + + +41 + + +response:916:read +50.05% +(0.00%) +129× + + + + + +41->2568 + + +0.71% + + + + +42 + + +stats:275:update +48.31% +(0.00%) +32× + + + + + +42->2568 + + +35.82% +39× + + + +43 + + +client:537:_read_next_chunk_size +37.64% +(0.02%) +64× + + + + + +43->2568 + + +0.94% +11× + + + +1946 + + +~:0:<method 'read' of '_io.BufferedReader' objects> +1.49% +(2.77%) +60076× + + + + + +866->1946 + + +0.18% +2394× + + + +53 + + +client:591:_read_chunked +49.92% +(0.00%) +128× + + + + + +2519 + + +standalone:133:__serve_once +59.42% +(0.00%) +31× + + + + + +53->2519 + + +10.47% +26× + + + +2519->42 + + +1.00% + + + + +56 + + +connection:369:request +2.67% +(0.00%) +125× + + + + + +57 + + +client:355:_stream_helper +50.33% +(0.00%) +129× + + + + + +59 + + +_pslinux:2291:gids +1.80% +(0.04%) +16833× + + + + + +2491->36 + + +0.23% +14501× + - -169 - - -selectors:402:select -5.33% -(0.00%) -68× - - - - - -30->169 - - -5.33% -68× - - - -1727 - - -~:0:<method 'poll' of 'select.poll' objects> -5.33% -(5.53%) -98× - - - - - -169->1727 - - -5.33% -68× - - - -31 - - -client:1082:_send_output -4.56% -(0.00%) -34× - - - - - -136 - - -~:0:<method 'acquire' of '_thread.lock' objects> -3.04% -(0.00%) -575× - - - - - -138 - - -<frozen importlib:1304:_find_and_load_unlocked -0.54% -(0.00%) -656× - - - - - -410 - - -<frozen importlib:911:_load_unlocked -0.54% -(0.00%) -628× - - - - - -138->410 - - -0.54% -40× - - - -2071 - - -<frozen importlib:989:exec_module -0.54% -(0.00%) -579× - - - - - -410->2071 - - -0.54% -40× - - - -143 - - -threading:1056:_bootstrap_inner -6.86% -(0.00%) -40× - - - - - -167 - - -__init__:2281:sensors_temperatures -2.56% -(0.00%) -10× - - - - - -174 - - -_pslinux:1376:sensors_temperatures -2.56% -(0.00%) -10× - - - - - -167->174 - - -0.21% - - - - -1834 - - -threading:1115:join -3.05% -(0.00%) -36× - - - - - -167->1834 - - -0.35% - - - - -1623 - - -_common:849:bcat -2.34% -(0.02%) -25517× - - - - - -174->1623 - - -0.20% -166× - - - -780 - - -_common:832:cat -2.42% -(0.04%) -26337× - - - - - -1623->780 - - -0.28% -2424× - - - -175 - - -_pslinux:1494:sensors_fans -0.99% -(0.00%) -10× - - - - - -210 - - -__init__:471:get_process_curses_data -2.38% -(0.56%) -30024× - - - - - -218 - - -battery:106:update -0.72% -(0.00%) -10× - - - - - -235 - - -thread:53:run -2.36% -(0.00%) -36× - - - - - -236 - - -multipass:92:update -5.38% -(0.00%) -17× - - - - - -359 - - -multipass:48:update_info -3.06% -(0.00%) -17× - - - - - -236->359 - - -3.06% -17× - - - -361 - - -multipass:34:update_version -2.32% -(0.00%) -17× - - - - - -236->361 - - -2.32% -17× - - - -668 - - -secure:17:secure_popen -5.38% -(0.00%) -34× - - - - - -359->668 - - -3.06% -17× - - - -361->668 - - -2.32% -17× - - - -238 - - -__init__:141:__get_sensor_data -2.36% -(0.00%) -36× - - - - - -239 - - -__init__:352:__fetch_psutil -2.60% -(0.00%) -20× - - - - - -239->167 - - -0.21% - - - - -263 - - -threading:1016:_bootstrap -8.16% -(0.00%) -40× - - - - - -270 - - -threading:999:run -2.36% -(0.00%) -36× - - - - - -286 - - -__init__:152:update -5.38% -(0.00%) -17× - - - - - -286->236 - - -5.38% -17× - - - -287 - - -__init__:507:msg_curse -2.44% -(0.02%) -60× - - - - - -287->210 - - -2.38% -30024× - - - -288 - - -__init__:167:update -2.36% -(0.00%) - - - - - -303 - - -subprocess:1165:communicate -5.36% -(0.00%) -37× +169 + + +~:0:<method 'readline' of '_io.BufferedReader' objects> +3.09% +(0.04%) +18448× - - -303->30 - - -5.34% -34× - - + -321 - - -<frozen importlib:1349:_find_and_load -0.55% -(0.00%) -659× +170 + + +~:0:<method 'acquire' of '_thread.lock' objects> +2.71% +(0.01%) +893× - - -321->138 - - -0.54% -39× + + +170->2568 + + +9.70% +10× - + -349 - - -sessions:673:send -4.66% -(0.00%) -34× +178 + + +_pslinux:1420:sensors_fans +0.66% +(0.00%) +11× - - -655 - - -secure:33:__secure_popen -5.38% -(0.00%) -34× + + +202 + + +__init__:2281:sensors_temperatures +1.64% +(0.00%) +11× - - -668->655 - - -5.38% -34× - - - -1243 - - -<frozen importlib:480:_call_with_frames_removed -0.53% -(0.00%) -1377× + + +209 + + +_pslinux:1302:sensors_temperatures +1.64% +(0.00%) +11× - - -2071->1243 - - -0.53% -40× + + +202->209 + + +0.15% + - + -433 - - -__init__:1491:process_iter -1.73% -(0.02%) -9545× +325 + + +threading:1115:join +2.71% +(0.00%) +39× - + + +202->325 + + +0.90% +14× + + + +209->44 + + +0.14% +169× + + -440 - - -stats:256:__update_plugin -11.07% -(0.01%) -899× +254 + + +thread:69:_worker +1.50% +(0.00%) +39× + + + + + +261 + + +battery:106:update +0.94% +(0.00%) +11× + + + + + +267 + + +__init__:334:__fetch_data +1.67% +(0.00%) +22× + + + + + +267->202 + + +0.15% + + + + +268 + + +__init__:349:update +1.50% +(0.00%) +20× + + + + + +302 + + +client:567:_get_chunk_left +42.01% +(0.00%) +128× + + + + + +343 + + +__init__:149:update +1.51% +(0.00%) +10× + + + + + +408 + + +sessions:673:send +2.93% +(0.01%) +125× + + + + + +508 + + +__init__:1481:process_iter +4.11% +(0.04%) +16861× - -511 - - -sessions:500:request -4.71% -(0.00%) -34× - - - - - -561 - - -glances_batpercent:98:update -0.67% -(0.00%) - - - - - - -564 - - -model:1139:wrapper -10.46% -(0.02%) -449× - - - - - -564->286 - - -5.38% -17× - - - -564->288 - - -2.36% - - - - -618 - - -connection:27:create_connection -4.56% -(0.00%) - - - - - - -655->303 - - -5.34% -34× - - - -662 - - -thread:69:_worker -2.36% -(0.00%) -36× - - - - -1795 - - -~:0:<method 'read' of '_io.BufferedReader' objects> -2.21% -(2.46%) -35321× +511 + + +client:463:read +49.92% +(0.00%) +130× - - -780->1795 - - -0.31% -2334× - - + -794 - - -__init__:143:main -96.39% -(0.00%) - +519 + + +stats:269:__update_plugin +7.68% +(0.01%) +868× - + -2109 - - -__init__:77:start -96.37% -(0.00%) - +1580 + + +model:492:update_views +0.79% +(0.25%) +868× - - -794->2109 - - -96.37% - + + +519->1580 + + +0.75% +487× - - -2109->321 - - -0.16% - - - - -801 - - -connectionpool:592:urlopen -4.64% -(0.00%) -34× - - - - - -817 - - -client:1320:endheaders -4.56% -(0.00%) -34× - - - - - -1276 - - -~:0:<built-in method builtins.exec> -96.48% -(0.03%) -826× - - - - - -1243->1276 - - -0.53% -40× - - - -1653 - - -run-venv:1:<module> -96.48% -(0.00%) - - - - - - -1276->1653 - - -96.48% - - - - -1653->794 - - -96.39% - - - - -1287 - - -__init__:545:as_dict -1.65% -(0.14%) -9531× - - - - - -2290 - - -_common:498:wrapper -0.82% -(0.08%) -98106× - - - - - -1287->2290 - - -0.28% -19055× - - - -1301 - - -stats:95:_load_plugin -0.62% -(0.00%) -34× - - - - - -1362 - - -client:1027:send -4.56% -(0.00%) -34× - - - - - -1377 - - -model:873:get_stats_display -2.50% -(0.00%) -1020× - - - - - -1377->287 - - -2.44% -60× - - - -1447 - - -adapters:613:send -4.65% -(0.00%) -34× - - - - + -1464 - - -api:14:request -4.57% -(0.00%) - +2652 + + +model:469:_build_view_for_field +0.60% +(0.33%) +503669× - + + +1580->2652 + + +0.60% +503669× + + + +595 + + +sessions:500:request +3.01% +(0.00%) +125× + + + + + +644 + + +glances_batpercent:62:update +0.90% +(0.00%) +10× + + + + + +646 + + +model:1155:wrapper +6.58% +(0.02%) +550× + + + + + +646->343 + + +1.51% +10× + + + +697 + + +connection:27:create_connection +2.65% +(0.00%) + + + + + + +867 + + +threading:1153:_wait_for_tstate_lock +2.71% +(0.00%) +40× + + + + + +888 + + +connectionpool:592:urlopen +2.89% +(0.00%) +125× + + + + + +899 + + +client:1320:endheaders +2.65% +(0.00%) +125× + + + + + +1427 + + +response:807:_fp_read +49.92% +(0.00%) +130× + + + + + +1493 + + +client:1027:send +2.65% +(0.00%) +125× + + + + + +1511 + + +model:893:get_stats_display +1.60% +(0.00%) +1020× + + + + + +1511->17 + + +0.39% +15× + + -1597 - - -glances_curses:476:__get_stat_display -2.50% -(0.00%) -30× +1585 + + +adapters:613:send +2.91% +(0.00%) +125× - - -1597->1377 - - -2.49% -990× - - + -1608 +1744 - -glances_curses:1093:update -90.24% -(0.02%) -30× + +glances_curses:475:__get_stat_display +1.54% +(0.00%) +30× - - -1608->2393 - - -0.76% - + + +1744->1511 + + +0.40% +245× - + -2400 - - -glances_curses:1079:flush -2.63% -(0.02%) -30× - - - - - -1608->2400 - - -2.63% -30× - - - -2385 - - -glances_curses:511:display -2.60% -(0.00%) -30× - - - - - -2400->2385 - - -2.60% -30× - - - -1609 - - -stats:262:update -11.06% -(0.00%) -31× - - - - - -1609->2393 - - -1.52% -10× - - - -1689 - - -~:0:<function socket.close at 0x7ec66a36d3a0> -4.56% -(0.00%) -12× - - - - - -1690 - - -socket:496:_real_close -4.56% -(0.00%) -12× - - - - - -1695 - - -threading:1153:_wait_for_tstate_lock -3.04% -(0.00%) -37× - - - - - -1702 - - -connection:369:request -4.57% -(0.00%) -34× - - - - - -1832 - - -__init__:367:update -2.35% -(0.00%) -18× - - - - - -1849 - - -_pslinux:1713:wrapper -1.30% -(0.14%) -170567× +1843 + + +~:0:<method 'connect' of '_socket.socket' objects> +2.65% +(0.14%) +18× - + 1850 - - -__init__:77:update -2.19% -(0.00%) -17× + + +~:0:<method 'recv_into' of '_socket.socket' objects> +3.09% +(4.54%) +188× - + + +1851 + + +socket:693:readinto +3.09% +(0.00%) +188× + + + + + +1949 + + +~:0:<built-in method time.sleep> +2.55% +(4.31%) +66× + + + + + +1984 + + +__init__:2321:sensors_fans +0.66% +(0.00%) +11× + + + + + +2001 + + +connectionpool:377:_make_request +2.86% +(0.00%) +125× + + + + + +2099 + + +thread:219:shutdown +1.51% +(0.00%) +10× + + + + + +2110->1744 + + +0.38% + + + + +2111->57 + + +0.80% + + + -1891 - - -processes:539:update -2.19% -(0.01%) -17× +4228 + + +~:0:<method 'getch' of '_curses.window' objects> +47.67% +(77.74%) +554× - + + +2111->4228 + + +0.53% + + + -1944 - - -thread:219:shutdown -2.36% -(0.00%) - +2160 + + +battery:35:__init__ +0.93% +(0.00%) +11× - + -1945 - - -glances_batpercent:62:update -0.67% -(0.00%) - +2162 + + +_base:646:__exit__ +1.51% +(0.00%) +10× - + -1998 - - -battery:35:__init__ -0.72% -(0.00%) -10× +2463 + + +processes:445:build_process_list +4.11% +(0.02%) +29× - + -2019 - - -connectionpool:377:_make_request -4.63% -(0.00%) -34× +2470 + + +glances_batpercent:98:update +0.90% +(0.00%) +10× - + -2280 - - -socket:500:close -4.56% -(0.00%) -12× +2488 + + +__init__:796:gids +1.81% +(0.01%) +16833× - + -2282 - - -processes:427:build_process_list -2.01% -(0.01%) -17× +2523 + + +connection:192:_new_conn +2.65% +(0.00%) + - + -2298 - - -standalone:136:__serve_once -100.00% -(0.00%) -30× +2524 + + +connection:275:connect +2.65% +(0.00%) + - - -2298->1609 - - -5.18% -15× - - + -2300 - - -__init__:2321:sensors_fans -0.99% -(0.00%) -10× +2805 + + +__init__:153:run +2.65% +(0.00%) + - + -2380 - - -standalone:174:serve_n -96.21% -(0.00%) - +3343 + + +json_stream:50:split_buffer +50.53% +(0.00%) +65× - - -2385->1597 - - -2.50% -30× - - - -3974 - - -~:0:<method 'getch' of '_curses.window' objects> -88.71% -(84.72%) -538× - - - - - -3464->3974 - - -0.76% - - - - -2394 - - -standalone:31:__init__ -0.64% -(0.00%) - - - - - - -2481 - - -connection:192:_new_conn -4.56% -(0.00%) - - - - - - -2486 - - -connection:275:connect -4.56% -(0.00%) - - - - - - -2594 - - -_base:646:__exit__ -2.36% -(0.00%) - - - - - - -2612 - - -__init__:153:run -4.57% -(0.00%) - - - - - - -3367 - - -api:62:get -4.57% -(0.00%) - - - - - - -4248 - - -standalone:181:serve_forever -96.21% -(0.00%) - + + +3465 + + +api:62:get +2.65% +(0.00%) + diff --git a/docs/_static/glances-flame.svg b/docs/_static/glances-flame.svg index 3ea04946..93a73b98 100644 --- a/docs/_static/glances-flame.svg +++ b/docs/_static/glances-flame.svg @@ -1,4 +1,4 @@ - \ No newline at end of file diff --git a/docs/_static/glances-pyinstrument.html b/docs/_static/glances-pyinstrument.html index a0e2ff0b..bafe5a1f 100644 --- a/docs/_static/glances-pyinstrument.html +++ b/docs/_static/glances-pyinstrument.html @@ -6,26 +6,26 @@
- diff --git a/docs/api.rst b/docs/api.rst index 5fbb680e..cdec4912 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -160,7 +160,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.47481369972229004}, + "timer": 0.35416603088378906}, {"count": 0, "countmax": 20.0, "countmin": None, @@ -169,7 +169,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.47472500801086426}] + "timer": 0.35405850410461426}] Fields descriptions: @@ -197,7 +197,7 @@ Get a specific item when field matches the given value:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.47481369972229004}]} + "timer": 0.35416603088378906}]} GET cloud --------- @@ -245,19 +245,17 @@ Get plugin stats:: "engine": "docker", "id": "454a8c7f059271f0e7fbb757375014115db3b6e0df2c039e66bb2647f717f67e", "image": ["timescale/timescaledb-ha:pg17"], - "io": {"cumulative_ior": 142082048, "cumulative_iow": 0}, + "io": {}, "io_rx": None, "io_wx": None, "key": "name", - "memory": {"inactive_file": 11075584, - "limit": 16421875712, - "usage": 73662464}, - "memory_inactive_file": 11075584, - "memory_limit": 16421875712, + "memory": {}, + "memory_inactive_file": None, + "memory_limit": None, "memory_percent": None, - "memory_usage": 73662464, + "memory_usage": None, "name": "timescaledb-for-glances", - "network": {"cumulative_rx": 853694, "cumulative_tx": 181084}, + "network": {}, "network_rx": None, "network_tx": None, "status": "running", @@ -299,21 +297,17 @@ Get a specific item when field matches the given value:: "engine": "docker", "id": "454a8c7f059271f0e7fbb757375014115db3b6e0df2c039e66bb2647f717f67e", "image": ["timescale/timescaledb-ha:pg17"], - "io": {"cumulative_ior": 142082048, - "cumulative_iow": 0}, + "io": {}, "io_rx": None, "io_wx": None, "key": "name", - "memory": {"inactive_file": 11075584, - "limit": 16421875712, - "usage": 73662464}, - "memory_inactive_file": 11075584, - "memory_limit": 16421875712, + "memory": {}, + "memory_inactive_file": None, + "memory_limit": None, "memory_percent": None, - "memory_usage": 73662464, + "memory_usage": None, "name": "timescaledb-for-glances", - "network": {"cumulative_rx": 853694, - "cumulative_tx": 181084}, + "network": {}, "network_rx": None, "network_tx": None, "status": "running", @@ -344,19 +338,19 @@ Get plugin stats:: # curl http://localhost:61208/api/4/cpu {"cpucore": 16, - "ctx_switches": 1092357433, + "ctx_switches": 1147082157, "guest": 0.0, - "idle": 92.1, - "interrupts": 498018187, - "iowait": 0.5, + "idle": 92.7, + "interrupts": 537821547, + "iowait": 0.3, "irq": 0.0, "nice": 0.0, - "soft_interrupts": 142021762, + "soft_interrupts": 159054185, "steal": 0.0, "syscalls": 0, - "system": 2.9, - "total": 6.9, - "user": 4.5} + "system": 2.7, + "total": 7.0, + "user": 4.3} Fields descriptions: @@ -389,7 +383,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/4/cpu/total - {"total": 6.9} + {"total": 7.0} GET diskio ---------- @@ -399,14 +393,14 @@ Get plugin stats:: # curl http://localhost:61208/api/4/diskio [{"disk_name": "nvme0n1", "key": "disk_name", - "read_bytes": 23662305280, - "read_count": 1285414, - "write_bytes": 42966279168, - "write_count": 3912353}, + "read_bytes": 25958311936, + "read_count": 1432838, + "write_bytes": 50359825408, + "write_count": 4407142}, {"disk_name": "nvme0n1p1", "key": "disk_name", - "read_bytes": 16233984, - "read_count": 1635, + "read_bytes": 25019904, + "read_count": 1842, "write_bytes": 1024, "write_count": 2}] @@ -442,10 +436,10 @@ Get a specific item when field matches the given value:: # curl http://localhost:61208/api/4/diskio/disk_name/value/nvme0n1 {"nvme0n1": [{"disk_name": "nvme0n1", "key": "disk_name", - "read_bytes": 23662305280, - "read_count": 1285414, - "write_bytes": 42966279168, - "write_count": 3912353}]} + "read_bytes": 25958311936, + "read_count": 1432838, + "write_bytes": 50359825408, + "write_count": 4407142}]} GET folders ----------- @@ -472,14 +466,14 @@ Get plugin stats:: # curl http://localhost:61208/api/4/fs [{"device_name": "/dev/mapper/ubuntu--vg-ubuntu--lv", - "free": 757348794368, + "free": 757015015424, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", "options": "rw,relatime", "percent": 20.5, "size": 1003736440832, - "used": 195325140992}, + "used": 195658919936}, {"device_name": "zsfpool", "free": 41680896, "fs_type": "zfs", @@ -510,14 +504,14 @@ Get a specific item when field matches the given value:: # curl http://localhost:61208/api/4/fs/mnt_point/value// {"/": [{"device_name": "/dev/mapper/ubuntu--vg-ubuntu--lv", - "free": 757348794368, + "free": 757015015424, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", "options": "rw,relatime", "percent": 20.5, "size": 1003736440832, - "used": 195325140992}]} + "used": 195658919936}]} GET gpu ------- @@ -550,7 +544,7 @@ GET ip Get plugin stats:: # curl http://localhost:61208/api/4/ip - {"address": "192.168.0.28", + {"address": "192.168.1.26", "mask": "255.255.255.0", "mask_cidr": 24, "public_address": "", @@ -568,7 +562,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/4/ip/address - {"address": "192.168.0.28"} + {"address": "192.168.1.26"} GET irq ------- @@ -589,7 +583,10 @@ GET load Get plugin stats:: # curl http://localhost:61208/api/4/load - {"cpucore": 16, "min1": 0.8486328125, "min15": 0.51953125, "min5": 0.5673828125} + {"cpucore": 16, + "min1": 1.38671875, + "min15": 0.69189453125, + "min5": 0.90283203125} Fields descriptions: @@ -601,7 +598,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/4/load/min1 - {"min1": 0.8486328125} + {"min1": 1.38671875} GET mem ------- @@ -609,16 +606,16 @@ GET mem Get plugin stats:: # curl http://localhost:61208/api/4/mem - {"active": 6821453824, - "available": 5580181504, - "buffers": 240480256, - "cached": 5894012928, - "free": 5580181504, - "inactive": 6609973248, - "percent": 66.0, - "shared": 845099008, + {"active": 6523793408, + "available": 5214130176, + "buffers": 172609536, + "cached": 3883290624, + "free": 5214130176, + "inactive": 5262598144, + "percent": 68.2, + "shared": 851185664, "total": 16421875712, - "used": 10841694208} + "used": 11207745536} Fields descriptions: @@ -645,13 +642,13 @@ GET memswap Get plugin stats:: # curl http://localhost:61208/api/4/memswap - {"free": 605421568, - "percent": 85.9, - "sin": 2137960448, - "sout": 9439567872, + {"free": 24600576, + "percent": 99.4, + "sin": 2413453312, + "sout": 10314559488, "time_since_update": 1, "total": 4294963200, - "used": 3689541632} + "used": 4270362624} Fields descriptions: @@ -676,32 +673,32 @@ Get plugin stats:: # curl http://localhost:61208/api/4/network [{"alias": None, "bytes_all": 0, - "bytes_all_gauge": 3507317697, + "bytes_all_gauge": 4956031212, "bytes_all_rate_per_sec": 0, "bytes_recv": 0, - "bytes_recv_gauge": 2938594709, + "bytes_recv_gauge": 4219856761, "bytes_recv_rate_per_sec": 0, "bytes_sent": 0, - "bytes_sent_gauge": 568722988, + "bytes_sent_gauge": 736174451, "bytes_sent_rate_per_sec": 0, "interface_name": "wlp0s20f3", "key": "interface_name", "speed": 0, - "time_since_update": 0.4779174327850342}, + "time_since_update": 0.3574516773223877}, {"alias": None, "bytes_all": 0, - "bytes_all_gauge": 1034778, + "bytes_all_gauge": 1144785, "bytes_all_rate_per_sec": 0, "bytes_recv": 0, - "bytes_recv_gauge": 181084, + "bytes_recv_gauge": 195116, "bytes_recv_rate_per_sec": 0, "bytes_sent": 0, - "bytes_sent_gauge": 853694, + "bytes_sent_gauge": 949669, "bytes_sent_rate_per_sec": 0, "interface_name": "veth620fda1", "key": "interface_name", "speed": 10485760000, - "time_since_update": 0.4779174327850342}] + "time_since_update": 0.3574516773223877}] Fields descriptions: @@ -730,18 +727,18 @@ Get a specific item when field matches the given value:: # curl http://localhost:61208/api/4/network/interface_name/value/wlp0s20f3 {"wlp0s20f3": [{"alias": None, "bytes_all": 0, - "bytes_all_gauge": 3507317697, + "bytes_all_gauge": 4956031212, "bytes_all_rate_per_sec": 0, "bytes_recv": 0, - "bytes_recv_gauge": 2938594709, + "bytes_recv_gauge": 4219856761, "bytes_recv_rate_per_sec": 0, "bytes_sent": 0, - "bytes_sent_gauge": 568722988, + "bytes_sent_gauge": 736174451, "bytes_sent_rate_per_sec": 0, "interface_name": "wlp0s20f3", "key": "interface_name", "speed": 0, - "time_since_update": 0.4779174327850342}]} + "time_since_update": 0.3574516773223877}]} GET now ------- @@ -749,7 +746,7 @@ GET now Get plugin stats:: # curl http://localhost:61208/api/4/now - {"custom": "2025-06-30 08:03:52 CEST", "iso": "2025-06-30T08:03:52+02:00"} + {"custom": "2025-07-05 10:00:54 CEST", "iso": "2025-07-05T10:00:54+02:00"} Fields descriptions: @@ -759,7 +756,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/4/now/iso - {"iso": "2025-06-30T08:03:52+02:00"} + {"iso": "2025-07-05T10:00:54+02:00"} GET percpu ---------- @@ -771,22 +768,22 @@ Get plugin stats:: "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 36.0, + "idle": 26.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": 7.0, - "total": 64.0, + "total": 74.0, "user": 0.0}, {"cpu_number": 1, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 46.0, + "idle": 34.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -795,8 +792,8 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 54.0, - "user": 0.0}] + "total": 66.0, + "user": 1.0}] Fields descriptions: @@ -827,12 +824,12 @@ Get plugin stats:: # curl http://localhost:61208/api/4/ports [{"description": "DefaultGateway", - "host": "192.168.0.254", + "host": "192.168.1.1", "indice": "port_0", "port": 0, "refresh": 30, "rtt_warning": None, - "status": 0.016374, + "status": 0.015165, "timeout": 3}] Fields descriptions: @@ -849,19 +846,19 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/4/ports/host - {"host": ["192.168.0.254"]} + {"host": ["192.168.1.1"]} Get a specific item when field matches the given value:: - # curl http://localhost:61208/api/4/ports/host/value/192.168.0.254 - {"192.168.0.254": [{"description": "DefaultGateway", - "host": "192.168.0.254", - "indice": "port_0", - "port": 0, - "refresh": 30, - "rtt_warning": None, - "status": 0.016374, - "timeout": 3}]} + # curl http://localhost:61208/api/4/ports/host/value/192.168.1.1 + {"192.168.1.1": [{"description": "DefaultGateway", + "host": "192.168.1.1", + "indice": "port_0", + "port": 0, + "refresh": 30, + "rtt_warning": None, + "status": 0.015165, + "timeout": 3}]} GET processcount ---------------- @@ -869,7 +866,7 @@ GET processcount Get plugin stats:: # curl http://localhost:61208/api/4/processcount - {"pid_max": 0, "running": 1, "sleeping": 436, "thread": 2343, "total": 583} + {"pid_max": 0, "running": 1, "sleeping": 445, "thread": 2471, "total": 592} Fields descriptions: @@ -882,7 +879,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/4/processcount/total - {"total": 583} + {"total": 592} GET processlist --------------- @@ -914,58 +911,43 @@ Get plugin stats:: "--disable-features=CalculateNativeWinOcclusion,SpareRendererForSitePerProcess", "--variations-seed-version"], "cpu_percent": 0.0, - "cpu_times": {"children_system": 1543.56, - "children_user": 450.0, + "cpu_times": {"children_system": 1748.1, + "children_user": 498.61, "iowait": 0.0, - "system": 1170.71, - "user": 2586.27}, + "system": 1395.93, + "user": 3554.47}, "gids": {"effective": 1000, "real": 1000, "saved": 1000}, - "io_counters": [1105124352, - 946724864, + "io_counters": [1253070848, + 1439047680, 0, 0, 0, - 41866240, - 245760, + 50158592, + 278528, 0, 0, 0, - 82590720, - 761856, + 105289728, + 991232, 0, 0, 0, - 73824256, - 0, - 0, - 0, - 0, - 2912256, - 0, - 0, - 0, - 0, - 75506688, - 171302912, - 0, - 0, - 0, - 47408128, + 51778560, 1474125824, 0, 0, 0, - 3125248, + 88620032, + 239845376, + 0, + 0, + 0, + 4370432, 0, 0, 0, 0, - 69190656, - 0, - 0, - 0, - 0, - 4582400, + 74962944, 0, 0, 0, @@ -975,42 +957,52 @@ Get plugin stats:: 0, 0, 0, - 2440192, + 75834368, 0, 0, 0, 0, - 570368, + 1781760, 0, 0, 0, 0, - 763904, + 3407872, 0, 0, 0, 0, - 1370112, + 4582400, 0, 0, 0, 0, - 37030912, - 323584, - 0, - 0, - 0, - 3002368, + 2583552, 0, 0, 0, 0, - 1824768, + 1947648, 0, 0, 0, 0, - 1480704, + 1452032, + 0, + 0, + 0, + 0, + 697344, + 0, + 0, + 0, + 0, + 1685504, + 0, + 0, + 0, + 0, + 3186688, 0, 0, 0, @@ -1020,8 +1012,13 @@ Get plugin stats:: 0, 0, 0, - 6110208, - 11436032, + 37030912, + 323584, + 0, + 0, + 0, + 7917568, + 13221888, 0, 0, 0, @@ -1036,14 +1033,14 @@ Get plugin stats:: 0, 0], "key": "pid", - "memory_info": {"data": 4177715200, + "memory_info": {"data": 4289839104, "dirty": 0, "lib": 0, - "rss": 1755660288, - "shared": 86052864, + "rss": 1786892288, + "shared": 46358528, "text": 142934016, - "vms": 1526241415168}, - "memory_percent": 10.690985115160029, + "vms": 1526241628160}, + "memory_percent": 10.881170454202497, "name": "code", "nice": 0, "num_threads": 75, @@ -1058,22 +1055,22 @@ Get plugin stats:: "cpu_times": {"children_system": 0.0, "children_user": 0.0, "iowait": 0.0, - "system": 165.24, - "user": 1982.29}, + "system": 226.94, + "user": 2816.36}, "gids": {"effective": 1000, "real": 1000, "saved": 1000}, - "io_counters": [41866240, 245760, 0, 0, 0], + "io_counters": [50158592, 278528, 0, 0, 0], "key": "pid", - "memory_info": {"data": 2355363840, + "memory_info": {"data": 2574012416, "dirty": 0, "lib": 0, - "rss": 1061679104, - "shared": 101523456, + "rss": 1171873792, + "shared": 79126528, "text": 142934016, - "vms": 1528181399552}, - "memory_percent": 6.4650294681270575, + "vms": 1535192395776}, + "memory_percent": 7.136053228947979, "name": "code", "nice": 0, - "num_threads": 41, + "num_threads": 45, "pid": 344538, "status": "S", "time_since_update": 1, @@ -1104,78 +1101,63 @@ Get plugin stats:: [{"childrens": [344596, 344538, 345057, - 345617, - 538299, - 344413, 344606, - 538473, - 344607, - 538298, + 344413, + 538299, + 345617, 757571, - 703317, - 750052, + 344607, 344509, - 703318, - 538321, - 538456, + 538473, + 538298, + 703317, 344729, + 703318, + 750052, 344987, + 538456, 345280, + 538321, 344492, 344416, 344415], "cmdline": ["code"], "cpu_percent": 0, - "cpu_times": {"children_system": 1545.1399999999999, - "children_user": 458.76000000000005, - "system": 1643.1800000000007, - "user": 6116.319999999998}, - "io_counters": [1105124352, - 946724864, + "cpu_times": {"children_system": 1749.6999999999998, + "children_user": 507.61000000000007, + "system": 2008.36, + "user": 8456.070000000002}, + "io_counters": [1253070848, + 1439047680, 0, 0, 0, - 41866240, - 245760, + 50158592, + 278528, 0, 0, 0, - 82590720, - 761856, + 105289728, + 991232, 0, 0, 0, - 73824256, - 0, - 0, - 0, - 0, - 2912256, - 0, - 0, - 0, - 0, - 75506688, - 171302912, - 0, - 0, - 0, - 47408128, + 51778560, 1474125824, 0, 0, 0, - 3125248, + 88620032, + 239845376, + 0, + 0, + 0, + 4370432, 0, 0, 0, 0, - 69190656, - 0, - 0, - 0, - 0, - 4582400, + 74962944, 0, 0, 0, @@ -1185,42 +1167,52 @@ Get plugin stats:: 0, 0, 0, - 2440192, + 75834368, 0, 0, 0, 0, - 570368, + 1781760, 0, 0, 0, 0, - 763904, + 3407872, 0, 0, 0, 0, - 1370112, + 4582400, 0, 0, 0, 0, - 37030912, - 323584, - 0, - 0, - 0, - 3002368, + 2583552, 0, 0, 0, 0, - 1824768, + 1947648, 0, 0, 0, 0, - 1480704, + 1452032, + 0, + 0, + 0, + 0, + 697344, + 0, + 0, + 0, + 0, + 1685504, + 0, + 0, + 0, + 0, + 3186688, 0, 0, 0, @@ -1230,8 +1222,13 @@ Get plugin stats:: 0, 0, 0, - 6110208, - 11436032, + 37030912, + 323584, + 0, + 0, + 0, + 7917568, + 13221888, 0, 0, 0, @@ -1245,16 +1242,16 @@ Get plugin stats:: 0, 0, 0], - "memory_info": {"data": 20879228928, - "rss": 5842026496, - "shared": 1605451776, + "memory_info": {"data": 21450272768, + "rss": 5078986752, + "shared": 785207296, "text": 3287482368, - "vms": 28613465911296}, - "memory_percent": 35.57466027909979, + "vms": 28620475490304}, + "memory_percent": 30.928176787311937, "name": "code", "nice": 0, "nprocs": 23, - "num_threads": 379, + "num_threads": 383, "pid": "_", "status": "S", "time_since_update": 1, @@ -1265,17 +1262,17 @@ Get plugin stats:: "cpu_times": {"children_system": 0.0, "children_user": 0.0, "iowait": 0.0, - "system": 135.48, - "user": 878.1}, - "io_counters": [86463488, 0, 0, 0, 0], - "memory_info": {"data": 1218269184, + "system": 160.28, + "user": 1042.28}, + "io_counters": [88540160, 0, 0, 0, 0], + "memory_info": {"data": 1267232768, "dirty": 0, "lib": 0, - "rss": 629018624, - "shared": 97775616, + "rss": 671899648, + "shared": 97771520, "text": 868352, - "vms": 25438253056}, - "memory_percent": 3.830370141824637, + "vms": 25486487552}, + "memory_percent": 4.091491494537503, "name": "WebExtensions", "nice": 0, "nprocs": 1, @@ -1315,34 +1312,34 @@ GET quicklook Get plugin stats:: # curl http://localhost:61208/api/4/quicklook - {"cpu": 6.9, + {"cpu": 7.0, "cpu_hz": 4475000000.0, - "cpu_hz_current": 895664875.0, + "cpu_hz_current": 2035806187.5, "cpu_log_core": 16, "cpu_name": "13th Gen Intel(R) Core(TM) i7-13620H", "cpu_phys_core": 10, - "load": 3.2, - "mem": 66.0, + "load": 4.3, + "mem": 68.2, "percpu": [{"cpu_number": 0, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 36.0, + "idle": 26.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": 7.0, - "total": 64.0, + "total": 74.0, "user": 0.0}, {"cpu_number": 1, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 46.0, + "idle": 34.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1351,13 +1348,28 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 54.0, - "user": 0.0}, + "total": 66.0, + "user": 1.0}, {"cpu_number": 2, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 46.0, + "idle": 33.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": 67.0, + "user": 1.0}, + {"cpu_number": 3, + "dpc": None, + "guest": 0.0, + "guest_nice": 0.0, + "idle": 35.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1366,73 +1378,28 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 1.0, - "total": 54.0, - "user": 0.0}, - {"cpu_number": 3, - "dpc": None, - "guest": 0.0, - "guest_nice": 0.0, - "idle": 46.0, - "interrupt": None, - "iowait": 1.0, - "irq": 0.0, - "key": "cpu_number", - "nice": 0.0, - "softirq": 0.0, - "steal": 0.0, - "system": 0.0, - "total": 54.0, + "total": 65.0, "user": 0.0}, {"cpu_number": 4, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 34.0, + "idle": 25.0, "interrupt": None, - "iowait": 2.0, + "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 4.0, - "total": 66.0, + "system": 2.0, + "total": 75.0, "user": 7.0}, {"cpu_number": 5, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 25.0, - "interrupt": None, - "iowait": 1.0, - "irq": 0.0, - "key": "cpu_number", - "nice": 0.0, - "softirq": 0.0, - "steal": 0.0, - "system": 15.0, - "total": 75.0, - "user": 6.0}, - {"cpu_number": 6, - "dpc": None, - "guest": 0.0, - "guest_nice": 0.0, - "idle": 42.0, - "interrupt": None, - "iowait": 1.0, - "irq": 0.0, - "key": "cpu_number", - "nice": 0.0, - "softirq": 0.0, - "steal": 0.0, - "system": 1.0, - "total": 58.0, - "user": 3.0}, - {"cpu_number": 7, - "dpc": None, - "guest": 0.0, - "guest_nice": 0.0, - "idle": 46.0, + "idle": 27.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1440,14 +1407,44 @@ Get plugin stats:: "nice": 0.0, "softirq": 0.0, "steal": 0.0, + "system": 8.0, + "total": 73.0, + "user": 1.0}, + {"cpu_number": 6, + "dpc": None, + "guest": 0.0, + "guest_nice": 0.0, + "idle": 29.0, + "interrupt": None, + "iowait": 1.0, + "irq": 0.0, + "key": "cpu_number", + "nice": 0.0, + "softirq": 0.0, + "steal": 0.0, + "system": 3.0, + "total": 71.0, + "user": 2.0}, + {"cpu_number": 7, + "dpc": None, + "guest": 0.0, + "guest_nice": 0.0, + "idle": 34.0, + "interrupt": None, + "iowait": 1.0, + "irq": 0.0, + "key": "cpu_number", + "nice": 0.0, + "softirq": 0.0, + "steal": 0.0, "system": 0.0, - "total": 54.0, + "total": 66.0, "user": 0.0}, {"cpu_number": 8, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 45.0, + "idle": 34.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1456,13 +1453,13 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 55.0, - "user": 2.0}, + "total": 66.0, + "user": 1.0}, {"cpu_number": 9, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 47.0, + "idle": 34.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1471,13 +1468,13 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 53.0, + "total": 66.0, "user": 0.0}, {"cpu_number": 10, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 46.0, + "idle": 32.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1486,13 +1483,13 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 54.0, - "user": 0.0}, + "total": 68.0, + "user": 2.0}, {"cpu_number": 11, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 46.0, + "idle": 35.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1501,13 +1498,13 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 54.0, + "total": 65.0, "user": 0.0}, {"cpu_number": 12, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 46.0, + "idle": 35.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1516,13 +1513,13 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 54.0, + "total": 65.0, "user": 0.0}, {"cpu_number": 13, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 46.0, + "idle": 35.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1531,28 +1528,13 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 54.0, + "total": 65.0, "user": 0.0}, {"cpu_number": 14, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 45.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": 55.0, - "user": 1.0}, - {"cpu_number": 15, - "dpc": None, - "guest": 0.0, - "guest_nice": 0.0, - "idle": 46.0, + "idle": 35.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1561,9 +1543,24 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 54.0, + "total": 65.0, + "user": 0.0}, + {"cpu_number": 15, + "dpc": None, + "guest": 0.0, + "guest_nice": 0.0, + "idle": 34.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": 66.0, "user": 1.0}], - "swap": 85.9} + "swap": 99.4} Fields descriptions: @@ -1601,14 +1598,14 @@ Get plugin stats:: "label": "Ambient", "type": "temperature_core", "unit": "C", - "value": 38, + "value": 42, "warning": 0}, {"critical": None, "key": "label", "label": "Ambient 3", "type": "temperature_core", "unit": "C", - "value": 33, + "value": 35, "warning": 0}] Fields descriptions: @@ -1670,7 +1667,7 @@ Get a specific item when field matches the given value:: "label": "Ambient", "type": "temperature_core", "unit": "C", - "value": 38, + "value": 42, "warning": 0}]} GET smart @@ -1714,7 +1711,7 @@ GET uptime Get plugin stats:: # curl http://localhost:61208/api/4/uptime - "8 days, 18:39:26" + "13 days, 20:36:24" GET version ----------- @@ -1759,8 +1756,8 @@ Get plugin stats:: # curl http://localhost:61208/api/4/wifi [{"key": "ssid", - "quality_level": -54.0, - "quality_link": 56.0, + "quality_level": -63.0, + "quality_link": 47.0, "ssid": "wlp0s20f3"}] Get a specific field:: @@ -1772,8 +1769,8 @@ Get a specific item when field matches the given value:: # curl http://localhost:61208/api/4/wifi/ssid/value/wlp0s20f3 {"wlp0s20f3": [{"key": "ssid", - "quality_level": -54.0, - "quality_link": 56.0, + "quality_level": -63.0, + "quality_link": 47.0, "ssid": "wlp0s20f3"}]} GET all stats @@ -1837,34 +1834,34 @@ GET stats history History of a plugin:: # curl http://localhost:61208/api/4/cpu/history - {"system": [["2025-06-30T08:03:53.461336", 2.9], - ["2025-06-30T08:03:54.573558", 0.9], - ["2025-06-30T08:03:55.604110", 0.9]], - "user": [["2025-06-30T08:03:53.461333", 4.5], - ["2025-06-30T08:03:54.573555", 1.1], - ["2025-06-30T08:03:55.604107", 1.1]]} + {"system": [["2025-07-05T08:00:56.009714+00:00", 2.7], + ["2025-07-05T08:00:57.081256+00:00", 0.9], + ["2025-07-05T08:00:58.101843+00:00", 0.9]], + "user": [["2025-07-05T08:00:56.009713+00:00", 4.3], + ["2025-07-05T08:00:57.081255+00:00", 1.4], + ["2025-07-05T08:00:58.101842+00:00", 1.4]]} Limit history to last 2 values:: # curl http://localhost:61208/api/4/cpu/history/2 - {"system": [["2025-06-30T08:03:54.573558", 0.9], - ["2025-06-30T08:03:55.604110", 0.9]], - "user": [["2025-06-30T08:03:54.573555", 1.1], - ["2025-06-30T08:03:55.604107", 1.1]]} + {"system": [["2025-07-05T08:00:57.081256+00:00", 0.9], + ["2025-07-05T08:00:58.101843+00:00", 0.9]], + "user": [["2025-07-05T08:00:57.081255+00:00", 1.4], + ["2025-07-05T08:00:58.101842+00:00", 1.4]]} History for a specific field:: # curl http://localhost:61208/api/4/cpu/system/history - {"system": [["2025-06-30T08:03:52.275187", 2.9], - ["2025-06-30T08:03:53.461336", 2.9], - ["2025-06-30T08:03:54.573558", 0.9], - ["2025-06-30T08:03:55.604110", 0.9]]} + {"system": [["2025-07-05T08:00:54.878479+00:00", 2.7], + ["2025-07-05T08:00:56.009714+00:00", 2.7], + ["2025-07-05T08:00:57.081256+00:00", 0.9], + ["2025-07-05T08:00:58.101843+00:00", 0.9]]} Limit history for a specific field to last 2 values:: # curl http://localhost:61208/api/4/cpu/system/history - {"system": [["2025-06-30T08:03:54.573558", 0.9], - ["2025-06-30T08:03:55.604110", 0.9]]} + {"system": [["2025-07-05T08:00:57.081256+00:00", 0.9], + ["2025-07-05T08:00:58.101843+00:00", 0.9]]} GET limits (used for thresholds) -------------------------------- diff --git a/docs/man/glances.1 b/docs/man/glances.1 index e9322d2f..5354d31d 100644 --- a/docs/man/glances.1 +++ b/docs/man/glances.1 @@ -28,7 +28,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" "Jun 30, 2025" "4.3.2_rc01" "Glances" +.TH "GLANCES" "1" "Jul 05, 2025" "4.3.2_rc01" "Glances" .SH NAME glances \- An eye on your system .SH SYNOPSIS diff --git a/glances/attribute.py b/glances/attribute.py index 67a400ef..83ef7f3d 100644 --- a/glances/attribute.py +++ b/glances/attribute.py @@ -8,7 +8,15 @@ """Attribute class.""" -from datetime import UTC, datetime +from datetime import datetime + +# Ugly hack waiting for Python 3.10 deprecation +try: + from datetime import UTC +except ImportError: + from datetime import timezone + + UTC = timezone.utc class GlancesAttribute: diff --git a/tests/test_core.py b/tests/test_core.py index 52886033..9e103547 100755 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -13,7 +13,15 @@ import json import time import unittest -from datetime import UTC, datetime +from datetime import datetime + +# Ugly hack waiting for Python 3.10 deprecation +try: + from datetime import UTC +except ImportError: + from datetime import timezone + + UTC = timezone.utc from glances import __version__ from glances.events_list import GlancesEventsList