-
Is there a way to limit the number of items monitored by processlist plugin? I only need the API to return the top 5 processes. Doing this should significantly reduce glances CPU consumption when not all processes are relevant. If this is not possible, what are the chances we could have this feature added to Glances? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Hi @mkanet interesting question you have :) In fact Glances already optimize the processlist plugin by doing the following:
If i understand, you want to make the N "number" configurable ? |
Beta Was this translation helpful? Give feedback.
-
Hi @nicolargo I just modified
to:
Now, the API returns only the top 5 items in processlist; reducing the API payload significantly. However, I want this to ONLY affect the API, not the Glances webserver GUI! I want the webserver GUI to still only display all the processes based on the browser's screen height. I am hoping I can convince you to add a feature to make "N" configurable for ONLY the API, not GUI. Thank you for all your hard work! Looking forward to the PR. |
Beta Was this translation helpful? Give feedback.
-
Implementation done in the develop branch #2528 Thanks for the issue request @mkanet ! |
Beta Was this translation helpful? Give feedback.
-
@nicolargo Thank you very much! I am curious how would I make a curl API query so that it returns data from ALL available plugins AND also limit processlist? Currently, I use the following command line with the small modification I made to:
I know your documentation says: Return a very big dictionary (avoid using this request, performances will be poor)... However, that is mostly because of |
Beta Was this translation helpful? Give feedback.
Hi @mkanet
interesting question you have :)
In fact Glances already optimize the processlist plugin by doing the following:
If i understand, you want to make the N "number" configurable ?