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_percpu.cpython-36.opt-1.pyc
3

Eo�c��@sHdZddlmZddlmZdddd�dd	dd�gZGd
d�de�ZdS)
zPer-CPU plugin.�)�cpu_percent)�
GlancesPlugin�userzUser CPU usage�%)�name�descriptionZy_unit�systemzSystem CPU usagecsHeZdZdZd�fdd�	Zdd�Zejejdd���Z	dd	d
�Z
�ZS)
�Pluginz~Glances per-CPU plugin.

    'stats' is a list of dictionaries that contain the utilization percentages
    for each CPU.
    Ncs"tt|�j||tgd�d|_dS)zInit the plugin.)�args�config�items_history_listZstats_init_valueTN)�superr	�__init__rZ
display_curse)�selfr
r)�	__class__��$/usr/lib/python3.6/glances_percpu.pyrs
zPlugin.__init__cCsdS)zReturn the key of the list.Z
cpu_numberr)rrrr�get_key&szPlugin.get_keycCs,|j�}|jdkr tjdd�}n||_|jS)z,Update per-CPU stats using the input method.ZlocalT)�percpu)Zget_init_valueZinput_methodr�get�stats)rrrrr�update*s

z
Plugin.updatecCsfg}|js|jjs|j�r"|S|jd�rHdjd�}|j|j|d��x6dD].}||jd
krbqNdj|�}|j|j|��qNWx�|jD]�}|j|j��|jd�r�ydj|d
�}Wntk
r�djd�}YnX|j|j|��xvdD]n}||jd
k�r�q�ydj||�}Wn tk
�r6djd�}YnX|j|j||j	|||d����q�Wq�W|S)z2Return the dict to display in the curse interface.Z	quicklookz{:7}zPER CPUZTITLErr�idle�iowait�stealrz{:>7}z{:6.1f}%Ztotalz{:>6}%�?)�header)rrrrr)rrrrr)
rr
rZis_disabled�format�appendZcurse_add_lineZcurse_new_line�	TypeErrorZ	get_alert)rr
Z	max_width�ret�msg�statZcpurrr�	msg_curse>s8





*zPlugin.msg_curse)NN)NN)�__name__�
__module__�__qualname__�__doc__rrrZ_check_decoratorZ_log_result_decoratorrr#�
__classcell__rr)rrr	s	r	N)r'Zglances.cpu_percentrZglances.plugins.glances_pluginrrr	rrrr�<module>
s