HEX
Server: LiteSpeed
System: Linux baran.dnsprotection.me 4.18.0-553.83.1.lve.el8.x86_64 #1 SMP Wed Nov 12 10:04:12 UTC 2025 x86_64
User: ddir12 (3618)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //usr/lib/python3.6/site-packages/glances/plugins/__pycache__/glances_processcount.cpython-36.pyc
3

Eo�c��@s`dZddlmZmZddlmZdddd�dd	dd�d
ddd�dd
dd�gZGdd�de�ZdS)zProcess count plugin.�)�glances_processes�sort_for_human)�
GlancesPlugin�totalzTotal number of processes�)�name�descriptionZy_unit�runningz!Total number of running processes�sleepingz"Total number of sleeping processes�threadzTotal number of threadscsPeZdZdZd
�fdd�	Zdd�Zdd�Zejej	d	d
���Z
ddd�Z�ZS)�Pluginz7Glances process count plugin.

    stats is a list
    Ncs tt|�j||td�d|_dS)zInit the plugin.)�args�config�items_history_listTN)�superr�__init__rZ
display_curse)�selfr
r)�	__class__��*/usr/lib/python3.6/glances_processcount.pyrszPlugin.__init__cCstj�dS)zEnable extended stats.N)r�enable_extended)rrrrr'szPlugin.enable_extendedcCstj�dS)zDisable extended stats.N)r�disable_extended)rrrrr+szPlugin.disable_extendedcCs:|j�}|jdkr$tj�tj�}n
|jdkr.||_|jS)z.Update processes stats using the input method.ZlocalZsnmp)Zget_init_valueZinput_methodr�updateZ	get_count�stats)rrrrrr/s


z
Plugin.updatecCs,g}|jr"d}|j|j|��|S|js,|Stjdk	r�d}|j|j|d��djtj�}tjdk	rr|djtj�7}|j|j|d��d}|j|j|��|j|j��d	}|j|j|d��|jd
}dj|jd
�}|j|j|��d|jk�rd
j|jd�}|j|j|��d|jk�rL||jd8}dj|jd�}|j|j|��d|jk�r�||jd8}dj|jd�}|j|j|��dj|�}|j|j|��|j	j
�r�dnd}yttj}Wnt
k
�r�tj}YnXtj�r
|d7}|j|j|��dj|�}n|dj|�7}|j|j|��|S)z2Return the dict to display in the curse interface.z)PROCESSES DISABLED (press 'z' to display)NzProcesses filter:ZTITLEz {} z
on column {} ZFILTERz('ENTER' to edit, 'E' to reset)ZTASKSrz{:>4}rz
 ({} thr),r	z {} run,r
z {} slp,z {} oth ZProgramsZThreadsz sorted automaticallyz by {}z
 sorted by {})Zdisable_process�appendZcurse_add_linerrZprocess_filter�formatZprocess_filter_keyZcurse_new_liner
ZprogramsrZsort_key�KeyErrorZ	auto_sort)rr
Z	max_width�ret�msg�otherZ
sort_humanrrr�	msg_curseGs^



zPlugin.msg_curse)NN)NN)
�__name__�
__module__�__qualname__�__doc__rrrrZ_check_decoratorZ_log_result_decoratorrr �
__classcell__rr)rrrs	rN)r$Zglances.processesrrZglances.plugins.glances_pluginrrrrrrr�<module>
s