Merge from develop

This commit is contained in:
nicolargo 2022-05-29 13:04:58 +02:00
commit d149a2f3a4
16 changed files with 362 additions and 353 deletions

View File

@ -45,44 +45,41 @@ docs-server: docs
webui: venv-dev webui: venv-dev
cd glances/outputs/static/ && npm ci && npm run build cd glances/outputs/static/ && npm ci && npm run build
run: venv run:
./venv/bin/python -m glances -C ./conf/glances.conf ./venv/bin/python -m glances -C ./conf/glances.conf
run-debug: venv run-debug:
./venv/bin/python -m glances -C ./conf/glances.conf -d ./venv/bin/python -m glances -C ./conf/glances.conf -d
run-webserver: venv run-webserver:
./venv/bin/python -m glances -C ./conf/glances.conf -w ./venv/bin/python -m glances -C ./conf/glances.conf -w
run-restapiserver: venv run-restapiserver:
./venv/bin/python -m glances -C ./conf/glances.conf -w --disable-webui ./venv/bin/python -m glances -C ./conf/glances.conf -w --disable-webui
run-server: venv run-server:
./venv/bin/python -m glances -C ./conf/glances.conf -s ./venv/bin/python -m glances -C ./conf/glances.conf -s
run-client: venv run-client:
./venv/bin/python -m glances -C ./conf/glances.conf -c localhost ./venv/bin/python -m glances -C ./conf/glances.conf -c localhost
run-browser: venv run-browser:
./venv/bin/python -m glances -C ./conf/glances.conf --browser ./venv/bin/python -m glances -C ./conf/glances.conf --browser
run-export-influxdb: venv show-version:
./venv/bin/python -m glances -C ./conf/glances.conf --export influxdb
show-version: venv
./venv/bin/python -m glances -C ./conf/glances.conf -V ./venv/bin/python -m glances -C ./conf/glances.conf -V
show-issue: venv show-issue:
./venv/bin/python -m glances -C ./conf/glances.conf --issue ./venv/bin/python -m glances -C ./conf/glances.conf --issue
profiling: venv venv-dev profiling:
@echo "Please complete and run: sudo ./venv/bin/py-spy record -o ./docs/_static/glances-flame.svg -d 60 -s --pid <GLANCES PID>" @echo "Please complete and run: sudo ./venv/bin/py-spy record -o ./docs/_static/glances-flame.svg -d 60 -s --pid <GLANCES PID>"
trace-malloc: venv trace-malloc:
@echo "Malloc test is running, please wait ~30 secondes..." @echo "Malloc test is running, please wait ~30 secondes..."
./venv/bin/python -m glances -C ./conf/glances.conf --trace-malloc --stop-after 15 --quiet ./venv/bin/python -m glances -C ./conf/glances.conf --trace-malloc --stop-after 15 --quiet
memory-leak: venv memory-leak:
./venv/bin/python -m glances -C ./conf/glances.conf --memory-leak ./venv/bin/python -m glances -C ./conf/glances.conf --memory-leak
release-note: release-note:

View File

@ -205,7 +205,7 @@ Available versions on the Docker Hub repository:
- *nicolargo/glances:latest-full* for a full Debian Glances image version with all dependencies - *nicolargo/glances:latest-full* for a full Debian Glances image version with all dependencies
- *nicolargo/glances:alpine-latest-full* for a full Alpine Glances image version with all dependencies - *nicolargo/glances:alpine-latest-full* for a full Alpine Glances image version with all dependencies
You can also specify a version by replacing latest by 3.2.3 (for example). You can also specify a version by replacing latest by 3.2.6.3 (for example).
Run last version of Glances container in *console mode*: Run last version of Glances container in *console mode*:
@ -219,15 +219,15 @@ create your own Dockerfile:
.. code-block:: console .. code-block:: console
FROM nicolargo/glances:latest FROM nicolargo/glances:latest
COPY glances.conf /glances/conf/glances.conf COPY glances.conf /etc/glances.conf
CMD python -m glances -C /glances/conf/glances.conf $GLANCES_OPT CMD python -m glances -C /etc/glances.conf $GLANCES_OPT
Alternatively, you can specify something along the same lines with Alternatively, you can specify something along the same lines with
docker run options: docker run options:
.. code-block:: console .. code-block:: console
docker run -v `pwd`/glances.conf:/glances/conf/glances.conf -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host -it nicolargo/glances:latest-full docker run -v `pwd`/glances.conf:/etc/glances.conf -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host -it nicolargo/glances:latest-full
Where \`pwd\`/glances.conf is a local directory containing your glances.conf file. Where \`pwd\`/glances.conf is a local directory containing your glances.conf file.

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 145 KiB

After

Width:  |  Height:  |  Size: 107 KiB

View File

@ -60,6 +60,25 @@ Get the plugins list::
"uptime", "uptime",
"wifi"] "wifi"]
GET alert
---------
Get plugin stats::
# curl http://localhost:61208/api/3/alert
[[1653511582.0,
-1,
"WARNING",
"MEM",
81.37629268155027,
81.37629268155027,
81.37629268155027,
81.37629268155027,
1,
[],
"",
"memory_percent"]]
GET amps GET amps
-------- --------
@ -74,7 +93,7 @@ Get plugin stats::
"refresh": 3.0, "refresh": 3.0,
"regex": True, "regex": True,
"result": None, "result": None,
"timer": 0.752385139465332}, "timer": 1.2215237617492676},
{"count": 0, {"count": 0,
"countmax": 20.0, "countmax": 20.0,
"countmin": None, "countmin": None,
@ -83,7 +102,7 @@ Get plugin stats::
"refresh": 3.0, "refresh": 3.0,
"regex": True, "regex": True,
"result": None, "result": None,
"timer": 0.7522008419036865}] "timer": 1.2214140892028809}]
Get a specific field:: Get a specific field::
@ -101,7 +120,7 @@ Get a specific item when field matchs the given value::
"refresh": 3.0, "refresh": 3.0,
"regex": True, "regex": True,
"result": None, "result": None,
"timer": 0.752385139465332}]} "timer": 1.2215237617492676}]}
GET core GET core
-------- --------
@ -131,19 +150,19 @@ Get plugin stats::
"ctx_switches": 0, "ctx_switches": 0,
"guest": 0.0, "guest": 0.0,
"guest_nice": 0.0, "guest_nice": 0.0,
"idle": 62.1, "idle": 68.6,
"interrupts": 0, "interrupts": 0,
"iowait": 0.0, "iowait": 0.1,
"irq": 0.0, "irq": 0.0,
"nice": 0.0, "nice": 0.0,
"soft_interrupts": 0, "soft_interrupts": 0,
"softirq": 0.0, "softirq": 0.0,
"steal": 0.0, "steal": 0.0,
"syscalls": 0, "syscalls": 0,
"system": 7.0, "system": 4.3,
"time_since_update": 1, "time_since_update": 1,
"total": 39.6, "total": 35.6,
"user": 30.8} "user": 27.0}
Fields descriptions: Fields descriptions:
@ -165,7 +184,7 @@ Fields descriptions:
Get a specific field:: Get a specific field::
# curl http://localhost:61208/api/3/cpu/total # curl http://localhost:61208/api/3/cpu/total
{"total": 39.6} {"total": 35.6}
GET diskio GET diskio
---------- ----------
@ -220,7 +239,7 @@ Get plugin stats::
"io_r": None, "io_r": None,
"io_w": None, "io_w": None,
"key": "name", "key": "name",
"memory_usage": 33189888, "memory_usage": 35647488,
"name": "telegraf", "name": "telegraf",
"network_rx": None, "network_rx": None,
"network_tx": None}, "network_tx": None},
@ -246,13 +265,13 @@ Get plugin stats::
# curl http://localhost:61208/api/3/fs # curl http://localhost:61208/api/3/fs
[{"device_name": "/dev/mapper/ubuntu--gnome--vg-root", [{"device_name": "/dev/mapper/ubuntu--gnome--vg-root",
"free": 99621335040, "free": 99862933504,
"fs_type": "ext4", "fs_type": "ext4",
"key": "mnt_point", "key": "mnt_point",
"mnt_point": "/", "mnt_point": "/",
"percent": 56.9, "percent": 56.8,
"size": 243396149248, "size": 243396149248,
"used": 131387359232}] "used": 131145760768}]
Get a specific field:: Get a specific field::
@ -263,13 +282,13 @@ Get a specific item when field matchs the given value::
# curl http://localhost:61208/api/3/fs/mnt_point// # curl http://localhost:61208/api/3/fs/mnt_point//
{"/": [{"device_name": "/dev/mapper/ubuntu--gnome--vg-root", {"/": [{"device_name": "/dev/mapper/ubuntu--gnome--vg-root",
"free": 99621335040, "free": 99862933504,
"fs_type": "ext4", "fs_type": "ext4",
"key": "mnt_point", "key": "mnt_point",
"mnt_point": "/", "mnt_point": "/",
"percent": 56.9, "percent": 56.8,
"size": 243396149248, "size": 243396149248,
"used": 131387359232}]} "used": 131145760768}]}
GET ip GET ip
------ ------
@ -277,16 +296,16 @@ GET ip
Get plugin stats:: Get plugin stats::
# curl http://localhost:61208/api/3/ip # curl http://localhost:61208/api/3/ip
{"address": "192.168.0.49", {"address": "192.168.0.33",
"gateway": "192.168.0.254", "gateway": "192.168.0.254",
"mask": "255.255.255.0", "mask": "255.255.255.0",
"mask_cidr": 24, "mask_cidr": 24,
"public_address": "82.66.169.82"} "public_address": "91.166.228.228"}
Get a specific field:: Get a specific field::
# curl http://localhost:61208/api/3/ip/address # curl http://localhost:61208/api/3/ip/address
{"address": "192.168.0.49"} {"address": "192.168.0.33"}
GET load GET load
-------- --------
@ -294,10 +313,7 @@ GET load
Get plugin stats:: Get plugin stats::
# curl http://localhost:61208/api/3/load # curl http://localhost:61208/api/3/load
{"cpucore": 4, {"cpucore": 4, "min1": 1.7607421875, "min15": 0.787109375, "min5": 1.0986328125}
"min1": 1.09228515625,
"min15": 0.95849609375,
"min5": 1.00048828125}
Fields descriptions: Fields descriptions:
@ -309,7 +325,7 @@ Fields descriptions:
Get a specific field:: Get a specific field::
# curl http://localhost:61208/api/3/load/min1 # curl http://localhost:61208/api/3/load/min1
{"min1": 1.09228515625} {"min1": 1.7607421875}
GET mem GET mem
------- -------
@ -317,16 +333,16 @@ GET mem
Get plugin stats:: Get plugin stats::
# curl http://localhost:61208/api/3/mem # curl http://localhost:61208/api/3/mem
{"active": 3533307904, {"active": 2994515968,
"available": 3111428096, "available": 1459716096,
"buffers": 323248128, "buffers": 120791040,
"cached": 3250700288, "cached": 2113867776,
"free": 3111428096, "free": 1459716096,
"inactive": 2721816576, "inactive": 3645423616,
"percent": 60.3, "percent": 81.4,
"shared": 543281152, "shared": 646406144,
"total": 7837945856, "total": 7837945856,
"used": 4726517760} "used": 6378229760}
Fields descriptions: Fields descriptions:
@ -353,13 +369,13 @@ GET memswap
Get plugin stats:: Get plugin stats::
# curl http://localhost:61208/api/3/memswap # curl http://localhost:61208/api/3/memswap
{"free": 6209282048, {"free": 6304215040,
"percent": 23.2, "percent": 22.0,
"sin": 732037120, "sin": 1377947648,
"sout": 2645266432, "sout": 3402825728,
"time_since_update": 1, "time_since_update": 1,
"total": 8082419712, "total": 8082419712,
"used": 1873137664} "used": 1778204672}
Fields descriptions: Fields descriptions:
@ -383,29 +399,29 @@ Get plugin stats::
# curl http://localhost:61208/api/3/network # curl http://localhost:61208/api/3/network
[{"alias": None, [{"alias": None,
"cumulative_cx": 162243466, "cumulative_cx": 473925792,
"cumulative_rx": 81121733, "cumulative_rx": 236962896,
"cumulative_tx": 81121733, "cumulative_tx": 236962896,
"cx": 2556, "cx": 4156,
"interface_name": "lo", "interface_name": "lo",
"is_up": True, "is_up": True,
"key": "interface_name", "key": "interface_name",
"rx": 1278, "rx": 2078,
"speed": 0, "speed": 0,
"time_since_update": 1, "time_since_update": 1,
"tx": 1278}, "tx": 2078},
{"alias": None, {"alias": None,
"cumulative_cx": 4744271709, "cumulative_cx": 5365392428,
"cumulative_rx": 4464070610, "cumulative_rx": 5016373584,
"cumulative_tx": 280201099, "cumulative_tx": 349018844,
"cx": 26523, "cx": 34101,
"interface_name": "wlp2s0", "interface_name": "wlp2s0",
"is_up": True, "is_up": True,
"key": "interface_name", "key": "interface_name",
"rx": 20315, "rx": 23539,
"speed": 0, "speed": 0,
"time_since_update": 1, "time_since_update": 1,
"tx": 6208}] "tx": 10562}]
Fields descriptions: Fields descriptions:
@ -437,17 +453,17 @@ Get a specific item when field matchs the given value::
# curl http://localhost:61208/api/3/network/interface_name/lo # curl http://localhost:61208/api/3/network/interface_name/lo
{"lo": [{"alias": None, {"lo": [{"alias": None,
"cumulative_cx": 162243466, "cumulative_cx": 473925792,
"cumulative_rx": 81121733, "cumulative_rx": 236962896,
"cumulative_tx": 81121733, "cumulative_tx": 236962896,
"cx": 2556, "cx": 4156,
"interface_name": "lo", "interface_name": "lo",
"is_up": True, "is_up": True,
"key": "interface_name", "key": "interface_name",
"rx": 1278, "rx": 2078,
"speed": 0, "speed": 0,
"time_since_update": 1, "time_since_update": 1,
"tx": 1278}]} "tx": 2078}]}
GET now GET now
------- -------
@ -455,7 +471,7 @@ GET now
Get plugin stats:: Get plugin stats::
# curl http://localhost:61208/api/3/now # curl http://localhost:61208/api/3/now
"2022-05-24 12:02:07 CEST" "2022-05-25 22:46:22 CEST"
GET percpu GET percpu
---------- ----------
@ -466,29 +482,29 @@ Get plugin stats::
[{"cpu_number": 0, [{"cpu_number": 0,
"guest": 0.0, "guest": 0.0,
"guest_nice": 0.0, "guest_nice": 0.0,
"idle": 57.0, "idle": 56.9,
"iowait": 0.0, "iowait": 0.0,
"irq": 0.0, "irq": 0.0,
"key": "cpu_number", "key": "cpu_number",
"nice": 0.0, "nice": 0.0,
"softirq": 0.0, "softirq": 0.0,
"steal": 0.0, "steal": 0.0,
"system": 7.0, "system": 4.6,
"total": 43.0, "total": 43.1,
"user": 26.0}, "user": 38.5},
{"cpu_number": 1, {"cpu_number": 1,
"guest": 0.0, "guest": 0.0,
"guest_nice": 0.0, "guest_nice": 0.0,
"idle": 68.0, "idle": 73.8,
"iowait": 0.0, "iowait": 0.0,
"irq": 0.0, "irq": 0.0,
"key": "cpu_number", "key": "cpu_number",
"nice": 0.0, "nice": 0.0,
"softirq": 0.0, "softirq": 0.0,
"steal": 0.0, "steal": 0.0,
"system": 6.0, "system": 4.6,
"total": 32.0, "total": 26.2,
"user": 17.0}] "user": 21.5}]
Get a specific field:: Get a specific field::
@ -507,7 +523,7 @@ Get plugin stats::
"port": 0, "port": 0,
"refresh": 30, "refresh": 30,
"rtt_warning": None, "rtt_warning": None,
"status": 0.004532, "status": 0.011961,
"timeout": 3}] "timeout": 3}]
Get a specific field:: Get a specific field::
@ -524,7 +540,7 @@ Get a specific item when field matchs the given value::
"port": 0, "port": 0,
"refresh": 30, "refresh": 30,
"rtt_warning": None, "rtt_warning": None,
"status": 0.004532, "status": 0.011961,
"timeout": 3}]} "timeout": 3}]}
GET processcount GET processcount
@ -533,12 +549,12 @@ GET processcount
Get plugin stats:: Get plugin stats::
# curl http://localhost:61208/api/3/processcount # curl http://localhost:61208/api/3/processcount
{"pid_max": 0, "running": 1, "sleeping": 255, "thread": 1394, "total": 320} {"pid_max": 0, "running": 1, "sleeping": 269, "thread": 1530, "total": 335}
Get a specific field:: Get a specific field::
# curl http://localhost:61208/api/3/processcount/total # curl http://localhost:61208/api/3/processcount/total
{"total": 320} {"total": 335}
GET processlist GET processlist
--------------- ---------------
@ -548,15 +564,15 @@ Get plugin stats::
# curl http://localhost:61208/api/3/processlist # curl http://localhost:61208/api/3/processlist
[{"cmdline": ["/snap/firefox/1300/usr/lib/firefox/firefox"], [{"cmdline": ["/snap/firefox/1300/usr/lib/firefox/firefox"],
"cpu_percent": 0.0, "cpu_percent": 0.0,
"cpu_times": pcputimes(user=4191.85, system=1588.46, children_user=3119.18, children_system=692.52, iowait=0.0), "cpu_times": pcputimes(user=7265.13, system=2644.4, children_user=4225.08, children_system=934.33, iowait=0.0),
"gids": pgids(real=1000, effective=1000, saved=1000), "gids": pgids(real=1000, effective=1000, saved=1000),
"io_counters": [1992798208, 5691990016, 0, 0, 0], "io_counters": [2597592064, 8660602880, 0, 0, 0],
"key": "pid", "key": "pid",
"memory_info": pmem(rss=459440128, vms=13888520192, shared=139042816, text=643072, lib=0, data=1830445056, dirty=0), "memory_info": pmem(rss=521797632, vms=14051770368, shared=142577664, text=643072, lib=0, data=1934319616, dirty=0),
"memory_percent": 5.861741538419732, "memory_percent": 6.657326314656288,
"name": "firefox", "name": "firefox",
"nice": 0, "nice": 0,
"num_threads": 153, "num_threads": 165,
"pid": 10259, "pid": 10259,
"ppid": 2922, "ppid": 2922,
"status": "S", "status": "S",
@ -581,12 +597,12 @@ Get plugin stats::
"true", "true",
"tab"], "tab"],
"cpu_percent": 0.0, "cpu_percent": 0.0,
"cpu_times": pcputimes(user=1055.29, system=197.09, children_user=0.0, children_system=0.0, iowait=0.0), "cpu_times": pcputimes(user=1572.98, system=303.12, children_user=0.0, children_system=0.0, iowait=0.0),
"gids": pgids(real=1000, effective=1000, saved=1000), "gids": pgids(real=1000, effective=1000, saved=1000),
"io_counters": [122664960, 0, 0, 0, 0], "io_counters": [157250560, 0, 0, 0, 0],
"key": "pid", "key": "pid",
"memory_info": pmem(rss=361443328, vms=3296440320, shared=56553472, text=643072, lib=0, data=714555392, dirty=0), "memory_info": pmem(rss=498479104, vms=3363688448, shared=77520896, text=643072, lib=0, data=767954944, dirty=0),
"memory_percent": 4.611454769406358, "memory_percent": 6.359818161009762,
"name": "WebExtensions", "name": "WebExtensions",
"nice": 0, "nice": 0,
"num_threads": 20, "num_threads": 20,
@ -601,169 +617,183 @@ Get a specific field::
# curl http://localhost:61208/api/3/processlist/pid # curl http://localhost:61208/api/3/processlist/pid
{"pid": [10259, {"pid": [10259,
10790, 10790,
271153,
271200,
10854,
20979, 20979,
10850, 10850,
21025,
21227,
10854,
2922, 2922,
21227,
271409,
21025,
240874,
62372, 62372,
186149, 308697,
10857, 10857,
271083,
271184,
10814, 10814,
20905, 308943,
21039, 309130,
216634, 306581,
271118,
12436, 12436,
216880, 309195,
216694, 306584,
217080, 309267,
185769, 271247,
52875, 271208,
176018,
217078,
2820,
337,
20947,
2033,
186877,
138834,
3251, 3251,
21107, 309448,
211759, 337,
2820,
271397,
52875,
243846,
2033,
234429,
271140,
3279,
138954, 138954,
11390, 11390,
265539,
138989, 138989,
3161, 138834,
1166, 271089,
266251,
2505,
3019, 3019,
271088,
1302,
186877,
2109,
3161,
186878, 186878,
10597, 10597,
3279,
20965,
1302,
21063,
183662,
2790, 2790,
2109, 304566,
21229,
3066,
3347,
8716,
2999,
1133,
3056,
3065,
3706, 3706,
2867, 8716,
3227, 20965,
183682, 3347,
1601, 3066,
1133,
2999,
232395,
3056,
21229,
3065,
3206, 3206,
8715, 8715,
1601,
1, 1,
3259,
2081,
1150,
3085,
2964,
3381,
1147,
2990, 2990,
2073, 2964,
3259,
3227,
3085,
232398,
2867,
1150,
3064, 3064,
2073,
3381,
218290,
1313, 1313,
2900, 2900,
2081,
1990, 1990,
183686, 20932,
1176,
2505,
20916,
20917,
989,
3058,
144959, 144959,
3178, 1147,
1176,
3077, 3077,
2769,
3062, 3062,
2781, 2781,
2769, 3058,
2933, 989,
3178,
20917,
20916,
3004, 3004,
8959, 2933,
3068, 271268,
1271,
2831, 2831,
3068,
8959,
1271,
8941, 8941,
1310,
1173,
216822,
1596,
2971,
3084,
1132,
3268,
10906, 10906,
2794,
1115,
1151,
3034, 3034,
3260, 241702,
3136, 1173,
2800, 2794,
2944,
3129,
2798,
2923,
3079,
3232,
3059,
1139,
3075,
12458, 12458,
1310,
1132,
2800,
1115,
2971,
2798,
1596,
3268,
1151,
2960,
3084,
3136,
3260,
3129,
3059,
2923,
2944,
3232,
3079,
1139,
1171, 1171,
138811,
3075,
1167, 1167,
3074, 3074,
3046,
2888,
24865,
2977, 2977,
3046,
138968,
2888,
2949, 2949,
1161,
2960,
3226, 3226,
1161,
24865,
138923,
3054, 3054,
381, 271091,
2828,
2788,
2079, 2079,
2828,
990, 990,
138811, 2788,
1127, 1127,
2868, 2868,
234438,
1156, 1156,
2789,
138923,
138968,
2805, 2805,
2789,
2080, 2080,
2988, 2988,
2931, 381,
1123, 1123,
1142, 1142,
211922, 2931,
2508, 2508,
21141,
1178,
1429, 1429,
135946, 1178,
21209,
988, 988,
1130, 1130,
21209,
8757, 8757,
217061, 266415,
309432,
997, 997,
1183, 1183,
271104,
996, 996,
1996, 1996,
3274, 3274,
@ -773,24 +803,23 @@ Get a specific field::
1116, 1116,
138788, 138788,
138767, 138767,
2782,
138752, 138752,
306441,
138731, 138731,
217077,
138901, 138901,
309447,
1914, 1914,
138774, 138774,
138745, 138745,
2782,
138724, 138724,
3053, 3053,
2012, 2012,
20932,
2020, 2020,
1186,
1997, 1997,
2001, 1186,
138894, 138894,
20919, 2001,
2, 2,
3, 3,
4, 4,
@ -900,46 +929,48 @@ Get a specific field::
2071, 2071,
2072, 2072,
2822, 2822,
183515, 20919,
210080, 20947,
210187, 282038,
210756, 303032,
210822, 303046,
213305, 304473,
213544, 304481,
214155, 304546,
214203, 305737,
214272, 305836,
214503, 305906,
214504, 305964,
214505, 306989,
214578, 307047,
215944, 307166,
215963, 307650,
216344, 308467,
216693, 308919,
217060]} 308920,
308925,
309347]}
Get a specific item when field matchs the given value:: Get a specific item when field matchs the given value::
# curl http://localhost:61208/api/3/processlist/pid/10259 # curl http://localhost:61208/api/3/processlist/pid/10259
{"10259": [{"cmdline": ["/snap/firefox/1300/usr/lib/firefox/firefox"], {"10259": [{"cmdline": ["/snap/firefox/1300/usr/lib/firefox/firefox"],
"cpu_percent": 0.0, "cpu_percent": 0.0,
"cpu_times": [4191.85, 1588.46, 3119.18, 692.52, 0.0], "cpu_times": [7265.13, 2644.4, 4225.08, 934.33, 0.0],
"gids": [1000, 1000, 1000], "gids": [1000, 1000, 1000],
"io_counters": [1992798208, 5691990016, 0, 0, 0], "io_counters": [2597592064, 8660602880, 0, 0, 0],
"key": "pid", "key": "pid",
"memory_info": [459440128, "memory_info": [521797632,
13888520192, 14051770368,
139042816, 142577664,
643072, 643072,
0, 0,
1830445056, 1934319616,
0], 0],
"memory_percent": 5.861741538419732, "memory_percent": 6.657326314656288,
"name": "firefox", "name": "firefox",
"nice": 0, "nice": 0,
"num_threads": 153, "num_threads": 165,
"pid": 10259, "pid": 10259,
"ppid": 2922, "ppid": 2922,
"status": "S", "status": "S",
@ -960,69 +991,69 @@ GET quicklook
Get plugin stats:: Get plugin stats::
# curl http://localhost:61208/api/3/quicklook # curl http://localhost:61208/api/3/quicklook
{"cpu": 39.6, {"cpu": 35.6,
"cpu_hz": 3000000000.0, "cpu_hz": 3000000000.0,
"cpu_hz_current": 1792000.0, "cpu_hz_current": 2860000.0,
"cpu_name": "Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz", "cpu_name": "Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz",
"mem": 60.3, "mem": 81.4,
"percpu": [{"cpu_number": 0, "percpu": [{"cpu_number": 0,
"guest": 0.0, "guest": 0.0,
"guest_nice": 0.0, "guest_nice": 0.0,
"idle": 57.0, "idle": 56.9,
"iowait": 0.0, "iowait": 0.0,
"irq": 0.0, "irq": 0.0,
"key": "cpu_number", "key": "cpu_number",
"nice": 0.0, "nice": 0.0,
"softirq": 0.0, "softirq": 0.0,
"steal": 0.0, "steal": 0.0,
"system": 7.0, "system": 4.6,
"total": 43.0, "total": 43.1,
"user": 26.0}, "user": 38.5},
{"cpu_number": 1, {"cpu_number": 1,
"guest": 0.0, "guest": 0.0,
"guest_nice": 0.0, "guest_nice": 0.0,
"idle": 68.0, "idle": 73.8,
"iowait": 0.0, "iowait": 0.0,
"irq": 0.0, "irq": 0.0,
"key": "cpu_number", "key": "cpu_number",
"nice": 0.0, "nice": 0.0,
"softirq": 0.0, "softirq": 0.0,
"steal": 0.0, "steal": 0.0,
"system": 6.0, "system": 4.6,
"total": 32.0, "total": 26.2,
"user": 17.0}, "user": 21.5},
{"cpu_number": 2, {"cpu_number": 2,
"guest": 0.0, "guest": 0.0,
"guest_nice": 0.0, "guest_nice": 0.0,
"idle": 60.0, "idle": 56.1,
"iowait": 0.0, "iowait": 0.8,
"irq": 0.0, "irq": 0.0,
"key": "cpu_number", "key": "cpu_number",
"nice": 0.0, "nice": 0.0,
"softirq": 0.0, "softirq": 0.0,
"steal": 0.0, "steal": 0.0,
"system": 7.0, "system": 4.5,
"total": 40.0, "total": 43.9,
"user": 21.0}, "user": 38.6},
{"cpu_number": 3, {"cpu_number": 3,
"guest": 0.0, "guest": 0.0,
"guest_nice": 0.0, "guest_nice": 0.0,
"idle": 31.0, "idle": 69.9,
"iowait": 0.0, "iowait": 0.0,
"irq": 0.0, "irq": 0.0,
"key": "cpu_number", "key": "cpu_number",
"nice": 0.0, "nice": 0.0,
"softirq": 0.0, "softirq": 0.0,
"steal": 0.0, "steal": 0.0,
"system": 5.0, "system": 3.0,
"total": 69.0, "total": 30.1,
"user": 54.0}], "user": 27.1}],
"swap": 23.2} "swap": 22.0}
Get a specific field:: Get a specific field::
# curl http://localhost:61208/api/3/quicklook/cpu # curl http://localhost:61208/api/3/quicklook/cpu
{"cpu": 39.6} {"cpu": 35.6}
GET sensors GET sensors
----------- -----------
@ -1093,7 +1124,7 @@ GET uptime
Get plugin stats:: Get plugin stats::
# curl http://localhost:61208/api/3/uptime # curl http://localhost:61208/api/3/uptime
{"seconds": 1370482} {"seconds": 1495537}
GET all stats GET all stats
------------- -------------
@ -1109,33 +1140,33 @@ GET stats history
History of a plugin:: History of a plugin::
# curl http://localhost:61208/api/3/cpu/history # curl http://localhost:61208/api/3/cpu/history
{"system": [["2022-05-24T12:02:07.760352", 7.0], {"system": [["2022-05-25T22:46:23.083039", 4.3],
["2022-05-24T12:02:08.818817", 7.0], ["2022-05-25T22:46:24.140665", 4.3],
["2022-05-24T12:02:09.906285", 1.1]], ["2022-05-25T22:46:25.239049", 5.5]],
"user": [["2022-05-24T12:02:07.760346", 30.8], "user": [["2022-05-25T22:46:23.083029", 27.0],
["2022-05-24T12:02:08.818813", 30.8], ["2022-05-25T22:46:24.140661", 27.0],
["2022-05-24T12:02:09.906281", 5.8]]} ["2022-05-25T22:46:25.239044", 10.7]]}
Limit history to last 2 values:: Limit history to last 2 values::
# curl http://localhost:61208/api/3/cpu/history/2 # curl http://localhost:61208/api/3/cpu/history/2
{"system": [["2022-05-24T12:02:08.818817", 7.0], {"system": [["2022-05-25T22:46:24.140665", 4.3],
["2022-05-24T12:02:09.906285", 1.1]], ["2022-05-25T22:46:25.239049", 5.5]],
"user": [["2022-05-24T12:02:08.818813", 30.8], "user": [["2022-05-25T22:46:24.140661", 27.0],
["2022-05-24T12:02:09.906281", 5.8]]} ["2022-05-25T22:46:25.239044", 10.7]]}
History for a specific field:: History for a specific field::
# curl http://localhost:61208/api/3/cpu/system/history # curl http://localhost:61208/api/3/cpu/system/history
{"system": [["2022-05-24T12:02:07.760352", 7.0], {"system": [["2022-05-25T22:46:23.083039", 4.3],
["2022-05-24T12:02:08.818817", 7.0], ["2022-05-25T22:46:24.140665", 4.3],
["2022-05-24T12:02:09.906285", 1.1]]} ["2022-05-25T22:46:25.239049", 5.5]]}
Limit history for a specific field to last 2 values:: Limit history for a specific field to last 2 values::
# curl http://localhost:61208/api/3/cpu/system/history # curl http://localhost:61208/api/3/cpu/system/history
{"system": [["2022-05-24T12:02:08.818817", 7.0], {"system": [["2022-05-25T22:46:24.140665", 4.3],
["2022-05-24T12:02:09.906285", 1.1]]} ["2022-05-25T22:46:25.239049", 5.5]]}
GET limits (used for thresholds) GET limits (used for thresholds)
-------------------------------- --------------------------------

View File

@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
.. ..
.TH "GLANCES" "1" "May 24, 2022" "3.2.6" "Glances" .TH "GLANCES" "1" "May 25, 2022" "3.2.6.3" "Glances"
.SH NAME .SH NAME
glances \- An eye on your system glances \- An eye on your system
.SH SYNOPSIS .SH SYNOPSIS

View File

@ -60,7 +60,7 @@ class Outdated(object):
# Read the configuration file # Read the configuration file
self.load_config(config) self.load_config(config)
if not PACKAGING_IMPORT: if not PACKAGING_IMPORT:
self.args.disable_check_update = False self.args.disable_check_update = True
logger.debug("Check Glances version up-to-date: {}".format(not self.args.disable_check_update)) logger.debug("Check Glances version up-to-date: {}".format(not self.args.disable_check_update))
# And update ! # And update !

View File

@ -1058,8 +1058,7 @@ class _GlancesCurses(object):
if not display_additional and m['additional']: if not display_additional and m['additional']:
continue continue
# Is it possible to display the stat with the current screen size # Is it possible to display the stat with the current screen size
# !!! Crash if not try/except... Why ??? if screen_x - x > 0:
try:
self.term_window.addnstr( self.term_window.addnstr(
y, y,
x, x,
@ -1068,19 +1067,8 @@ class _GlancesCurses(object):
screen_x - x, screen_x - x,
self.colors_list[m['decoration']], self.colors_list[m['decoration']],
) )
except Exception:
pass
else:
# New column # New column
# Python 2: we need to decode to get real screen size because
# UTF-8 special tree chars occupy several bytes.
# Python 3: strings are strings and bytes are bytes, all is
# good.
try:
x += len(u(m['msg'])) x += len(u(m['msg']))
except UnicodeDecodeError:
# Quick and dirty hack for issue #745
pass
if x > x_max: if x > x_max:
x_max = x x_max = x

View File

@ -314,9 +314,9 @@ class PluginModel(GlancesPluginModel):
ret.append(self.curse_add_line(msg, self.get_views(key='total', option='decoration'))) ret.append(self.curse_add_line(msg, self.get_views(key='total', option='decoration')))
# Idle CPU # Idle CPU
if 'idle' in self.stats and not idle_tag: if 'idle' in self.stats and not idle_tag:
msg = ' {:8}'.format('idle:') msg = ' {:8}'.format('idle')
ret.append(self.curse_add_line(msg, optional=self.get_views(key='idle', option='optional'))) ret.append(self.curse_add_line(msg, optional=self.get_views(key='idle', option='optional')))
msg = '{:5.1f}%'.format(self.stats['idle']) msg = '{:4.1f}%'.format(self.stats['idle'])
ret.append(self.curse_add_line(msg, optional=self.get_views(key='idle', option='optional'))) ret.append(self.curse_add_line(msg, optional=self.get_views(key='idle', option='optional')))
# ctx_switches # ctx_switches
if 'ctx_switches' in self.stats: if 'ctx_switches' in self.stats:
@ -347,11 +347,7 @@ class PluginModel(GlancesPluginModel):
msg = '{:5.1f}%'.format(self.stats['idle']) msg = '{:5.1f}%'.format(self.stats['idle'])
ret.append(self.curse_add_line(msg)) ret.append(self.curse_add_line(msg))
# IRQ CPU # IRQ CPU
if 'irq' in self.stats: ret.extend(self.curse_add_stat('irq', width=14, header=' '))
msg = ' {:8}'.format('irq:')
ret.append(self.curse_add_line(msg, optional=self.get_views(key='irq', option='optional')))
msg = '{:5.1f}%'.format(self.stats['irq'])
ret.append(self.curse_add_line(msg, optional=self.get_views(key='irq', option='optional')))
# interrupts # interrupts
if 'interrupts' in self.stats: if 'interrupts' in self.stats:
msg = ' {:8}'.format('inter:') msg = ' {:8}'.format('inter:')
@ -373,11 +369,7 @@ class PluginModel(GlancesPluginModel):
msg = '{:>6}'.format(self.stats['nb_log_core']) msg = '{:>6}'.format(self.stats['nb_log_core'])
ret.append(self.curse_add_line(msg)) ret.append(self.curse_add_line(msg))
# Nice CPU # Nice CPU
if 'nice' in self.stats: ret.extend(self.curse_add_stat('nice', width=14, header=' '))
msg = ' {:8}'.format('nice:')
ret.append(self.curse_add_line(msg, optional=self.get_views(key='nice', option='optional')))
msg = '{:5.1f}%'.format(self.stats['nice'])
ret.append(self.curse_add_line(msg, optional=self.get_views(key='nice', option='optional')))
# soft_interrupts # soft_interrupts
if 'soft_interrupts' in self.stats: if 'soft_interrupts' in self.stats:
msg = ' {:8}'.format('sw_int:') msg = ' {:8}'.format('sw_int:')
@ -401,18 +393,7 @@ class PluginModel(GlancesPluginModel):
) )
) )
# Steal CPU usage # Steal CPU usage
if 'steal' in self.stats: ret.extend(self.curse_add_stat('steal', width=14, header=' '))
msg = ' {:8}'.format('steal:')
ret.append(self.curse_add_line(msg, optional=self.get_views(key='steal', option='optional')))
msg = '{:5.1f}%'.format(self.stats['steal'])
ret.append(
self.curse_add_line(
msg,
self.get_views(key='steal', option='decoration'),
optional=self.get_views(key='steal', option='optional'),
)
)
# syscalls
# syscalls: number of system calls since boot. Always set to 0 on Linux. (do not display) # syscalls: number of system calls since boot. Always set to 0 on Linux. (do not display)
if 'syscalls' in self.stats and not LINUX: if 'syscalls' in self.stats and not LINUX:
msg = ' {:8}'.format('syscal:') msg = ' {:8}'.format('syscal:')

View File

@ -23,7 +23,6 @@ import os
import threading import threading
import time import time
from copy import deepcopy from copy import deepcopy
from dateutil import parser
from glances.compat import iterkeys, itervalues, nativestr, pretty_date from glances.compat import iterkeys, itervalues, nativestr, pretty_date
from glances.logger import logger from glances.logger import logger
@ -37,10 +36,11 @@ from glances.timer import getTimeSinceLastUpdate
# https://github.com/docker/docker-py # https://github.com/docker/docker-py
try: try:
import docker import docker
from dateutil import parser
except Exception as e: except Exception as e:
import_error_tag = True import_error_tag = True
# Display debug message if import KeyError # Display debug message if import KeyError
logger.warning("Error loading Docker Python Lib. Docker plugin is disabled ({})".format(e)) logger.warning("Error loading Docker deps Lib. Docker plugin is disabled ({})".format(e))
else: else:
import_error_tag = False import_error_tag = False

View File

@ -2,7 +2,7 @@
# #
# This file is part of Glances. # This file is part of Glances.
# #
# Copyright (C) 2019 Nicolargo <nicolas@nicolargo.com> # Copyright (C) 2022 Nicolargo <nicolas@nicolargo.com>
# #
# Glances is free software; you can redistribute it and/or modify # Glances is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by # it under the terms of the GNU Lesser General Public License as published by
@ -47,7 +47,10 @@ waiting in the run-queue plus the number currently executing \
over 15 minutes.', over 15 minutes.',
'unit': 'float', 'unit': 'float',
}, },
'cpucore': {'description': 'Total number of CPU core.', 'unit': 'number'}, 'cpucore': {
'description': 'Total number of CPU core.',
'unit': 'number'
},
} }
# SNMP OID # SNMP OID
@ -167,7 +170,7 @@ class PluginModel(GlancesPluginModel):
# Build the string message # Build the string message
# Header # Header
msg = '{:6}'.format('LOAD%' if (args.disable_irix and self.nb_log_core != 0) else 'LOAD') msg = '{:5}'.format('LOAD')
ret.append(self.curse_add_line(msg, "TITLE")) ret.append(self.curse_add_line(msg, "TITLE"))
# Core number # Core number
if 'cpucore' in self.stats and self.stats['cpucore'] > 0: if 'cpucore' in self.stats and self.stats['cpucore'] > 0:
@ -176,18 +179,16 @@ class PluginModel(GlancesPluginModel):
# Loop over 1min, 5min and 15min load # Loop over 1min, 5min and 15min load
for load_time in ['1', '5', '15']: for load_time in ['1', '5', '15']:
ret.append(self.curse_new_line()) ret.append(self.curse_new_line())
msg = '{:8}'.format('{} min:'.format(load_time)) msg = '{:7}'.format('{} min'.format(load_time))
ret.append(self.curse_add_line(msg)) ret.append(self.curse_add_line(msg))
if args.disable_irix and self.nb_log_core != 0: if args.disable_irix and self.nb_log_core != 0:
# Enable Irix mode for load (see issue #1554) # Enable Irix mode for load (see issue #1554)
load_stat = self.stats['min{}'.format(load_time)] / self.nb_log_core * 100 load_stat = self.stats['min{}'.format(load_time)] / self.nb_log_core * 100
msg = '{:>5.1f}%'.format(load_stat)
else: else:
# Default mode for load
load_stat = self.stats['min{}'.format(load_time)] load_stat = self.stats['min{}'.format(load_time)]
msg = '{:>6.2f}'.format(load_stat) msg = '{:>6.2f}'.format(load_stat)
if load_time == '1':
ret.append(self.curse_add_line(msg))
else:
# Alert is only for 5 and 15 min
ret.append(self.curse_add_line(msg, self.get_views(key='min{}'.format(load_time), option='decoration'))) ret.append(self.curse_add_line(msg, self.get_views(key='min{}'.format(load_time), option='decoration')))
return ret return ret

View File

@ -2,7 +2,7 @@
# #
# This file is part of Glances. # This file is part of Glances.
# #
# Copyright (C) 2021 Nicolargo <nicolas@nicolargo.com> # Copyright (C) 2022 Nicolargo <nicolas@nicolargo.com>
# #
# Glances is free software; you can redistribute it and/or modify # Glances is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by # it under the terms of the GNU Lesser General Public License as published by
@ -57,11 +57,17 @@ note that this doesn\'t reflect the actual memory available (use \'available\' i
'unit': 'bytes', 'unit': 'bytes',
'min_symbol': 'K', 'min_symbol': 'K',
}, },
'inactive': {'description': '*(UNIX)*: memory that is marked as not used.', 'unit': 'bytes', 'min_symbol': 'K'}, 'inactive': {
'description': '*(UNIX)*: memory that is marked as not used.',
'unit': 'bytes',
'min_symbol': 'K',
'short_name': 'inacti',
},
'buffers': { 'buffers': {
'description': '*(Linux, BSD)*: cache for things like file system metadata.', 'description': '*(Linux, BSD)*: cache for things like file system metadata.',
'unit': 'bytes', 'unit': 'bytes',
'min_symbol': 'K', 'min_symbol': 'K',
'short_name': 'buffer',
}, },
'cached': {'description': '*(Linux, BSD)*: cache for various things.', 'unit': 'bytes', 'min_symbol': 'K'}, 'cached': {'description': '*(Linux, BSD)*: cache for various things.', 'unit': 'bytes', 'min_symbol': 'K'},
'wired': { 'wired': {
@ -258,7 +264,7 @@ class PluginModel(GlancesPluginModel):
msg = '{:>7.1%}'.format(self.stats['percent'] / 100) msg = '{:>7.1%}'.format(self.stats['percent'] / 100)
ret.append(self.curse_add_line(msg, self.get_views(key='percent', option='decoration'))) ret.append(self.curse_add_line(msg, self.get_views(key='percent', option='decoration')))
# Active memory usage # Active memory usage
ret.extend(self.curse_add_stat('active', width=18, header=' ')) ret.extend(self.curse_add_stat('active', width=16, header=' '))
# Second line # Second line
# total + inactive # total + inactive
@ -266,7 +272,7 @@ class PluginModel(GlancesPluginModel):
# Total memory usage # Total memory usage
ret.extend(self.curse_add_stat('total', width=15)) ret.extend(self.curse_add_stat('total', width=15))
# Inactive memory usage # Inactive memory usage
ret.extend(self.curse_add_stat('inactive', width=18, header=' ')) ret.extend(self.curse_add_stat('inactive', width=16, header=' '))
# Third line # Third line
# used + buffers # used + buffers
@ -274,7 +280,7 @@ class PluginModel(GlancesPluginModel):
# Used memory usage # Used memory usage
ret.extend(self.curse_add_stat('used', width=15)) ret.extend(self.curse_add_stat('used', width=15))
# Buffers memory usage # Buffers memory usage
ret.extend(self.curse_add_stat('buffers', width=18, header=' ')) ret.extend(self.curse_add_stat('buffers', width=16, header=' '))
# Fourth line # Fourth line
# free + cached # free + cached
@ -282,6 +288,6 @@ class PluginModel(GlancesPluginModel):
# Free memory usage # Free memory usage
ret.extend(self.curse_add_stat('free', width=15)) ret.extend(self.curse_add_stat('free', width=15))
# Cached memory usage # Cached memory usage
ret.extend(self.curse_add_stat('cached', width=18, header=' ')) ret.extend(self.curse_add_stat('cached', width=16, header=' '))
return ret return ret

View File

@ -172,9 +172,9 @@ class PluginModel(GlancesPluginModel):
# First line # First line
# total% # total%
msg = '{}'.format('SWAP') msg = '{:4}'.format('SWAP')
ret.append(self.curse_add_line(msg, "TITLE")) ret.append(self.curse_add_line(msg, "TITLE"))
msg = ' {:3}'.format(self.trend_msg(self.get_trend('percent'))) msg = ' {:2}'.format(self.trend_msg(self.get_trend('percent')))
ret.append(self.curse_add_line(msg)) ret.append(self.curse_add_line(msg))
# Percent memory usage # Percent memory usage
msg = '{:>6.1%}'.format(self.stats['percent'] / 100) msg = '{:>6.1%}'.format(self.stats['percent'] / 100)
@ -184,18 +184,18 @@ class PluginModel(GlancesPluginModel):
# total # total
ret.append(self.curse_new_line()) ret.append(self.curse_new_line())
# Total memory usage # Total memory usage
ret.extend(self.curse_add_stat('total', width=16)) ret.extend(self.curse_add_stat('total', width=15))
# Third line # Third line
# used # used
ret.append(self.curse_new_line()) ret.append(self.curse_new_line())
# Used memory usage # Used memory usage
ret.extend(self.curse_add_stat('used', width=16)) ret.extend(self.curse_add_stat('used', width=15))
# Fourth line # Fourth line
# free # free
ret.append(self.curse_new_line()) ret.append(self.curse_new_line())
# Free memory usage # Free memory usage
ret.extend(self.curse_add_stat('free', width=16)) ret.extend(self.curse_add_stat('free', width=15))
return ret return ret

View File

@ -38,7 +38,9 @@ from glances.timer import Counter, Timer
from glances.outputs.glances_unicode import unicode_message from glances.outputs.glances_unicode import unicode_message
fields_unit_short = {'percent': '%'} fields_unit_short = {
'percent': '%'
}
fields_unit_type = { fields_unit_type = {
'percent': 'float', 'percent': 'float',
@ -52,7 +54,7 @@ fields_unit_type = {
'second': 'int', 'second': 'int',
'seconds': 'int', 'seconds': 'int',
'byte': 'int', 'byte': 'int',
'bytes': 'int', 'bytes': 'int'
} }
@ -978,7 +980,7 @@ class GlancesPluginModel(object):
"""Go to a new line.""" """Go to a new line."""
return self.curse_add_line('\n') return self.curse_add_line('\n')
def curse_add_stat(self, key, width=None, header='', separator='', trailer=''): def curse_add_stat(self, key, width=None, header='', display_key=True, separator='', trailer=''):
"""Return a list of dict messages with the 'key: value' result """Return a list of dict messages with the 'key: value' result
<=== width ===> <=== width ===>
@ -986,8 +988,8 @@ class GlancesPluginModel(object):
| | | | |_ trailer | | | | |_ trailer
| | | |_ self.stats[key] | | | |_ self.stats[key]
| | |_ separator | | |_ separator
| |_ key | |_ 'short_name' description or key or nothing if display_key is True
|_ trailer |_ header
Instead of: Instead of:
msg = ' {:8}'.format('idle:') msg = ' {:8}'.format('idle:')
@ -1003,7 +1005,9 @@ class GlancesPluginModel(object):
return [] return []
# Check if a shortname is defined # Check if a shortname is defined
if key in self.fields_description and 'short_name' in self.fields_description[key]: if not display_key:
key_name = ''
elif key in self.fields_description and 'short_name' in self.fields_description[key]:
key_name = self.fields_description[key]['short_name'] key_name = self.fields_description[key]['short_name']
else: else:
key_name = key key_name = key

View File

@ -36,7 +36,7 @@ class GlancesProcesses(object):
def __init__(self, cache_timeout=60): def __init__(self, cache_timeout=60):
"""Init the class to collect stats about processes.""" """Init the class to collect stats about processes."""
# Add internals caches because psutil do not cache all the stats # Add internals caches because psutil do not cache all the stats
# See: https://code.google.com/p/psutil/issues/detail?id=462 # See: https://github.com/giampaolo/psutil/issues/462
self.username_cache = {} self.username_cache = {}
self.cmdline_cache = {} self.cmdline_cache = {}
@ -45,7 +45,7 @@ class GlancesProcesses(object):
# First iteration, no cache # First iteration, no cache
self.cache_timer = Timer(0) self.cache_timer = Timer(0)
# Init the io dict # Init the io_old dict used to compute the IO bitrate
# key = pid # key = pid
# value = [ read_bytes_old, write_bytes_old ] # value = [ read_bytes_old, write_bytes_old ]
self.io_old = {} self.io_old = {}
@ -260,8 +260,8 @@ class GlancesProcesses(object):
# Grab standard stats # Grab standard stats
##################### #####################
sorted_attrs = ['cpu_percent', 'cpu_times', 'memory_percent', 'name', 'status', 'status', 'num_threads'] sorted_attrs = ['cpu_percent', 'cpu_times', 'memory_percent', 'name', 'status', 'num_threads']
displayed_attr = ['memory_info', 'nice', 'pid', 'ppid'] displayed_attr = ['memory_info', 'nice', 'pid']
cached_attrs = ['cmdline', 'username'] cached_attrs = ['cmdline', 'username']
# Some stats are optional # Some stats are optional

View File

@ -28,6 +28,7 @@ python-dateutil
pyzmq pyzmq
requests requests
scandir; python_version < "3.5" scandir; python_version < "3.5"
six
sparklines sparklines
statsd statsd
wifi wifi

View File

@ -50,7 +50,7 @@ def get_install_extras_require():
'action': ['chevron'], 'action': ['chevron'],
'browser': ['zeroconf>=0.19.1'], 'browser': ['zeroconf>=0.19.1'],
'cloud': ['requests'], 'cloud': ['requests'],
'docker': ['docker>=2.0.0', 'python-dateutil'], 'docker': ['docker>=2.0.0', 'python-dateutil', 'six'],
'export': ['bernhard', 'cassandra-driver', 'couchdb', 'elasticsearch', 'export': ['bernhard', 'cassandra-driver', 'couchdb', 'elasticsearch',
'graphitesender', 'influxdb>=1.0.0', 'influxdb-client', 'graphitesender', 'influxdb>=1.0.0', 'influxdb-client',
'kafka-python', 'pika', 'paho-mqtt', 'potsdb', 'prometheus_client', 'kafka-python', 'pika', 'paho-mqtt', 'potsdb', 'prometheus_client',