관리-도구
편집 파일: lvestats_memory_usage.cpython-311.pyc
� �Cg% � �R � d dl Z d dlZd dlZd dlmZ d dlmZ G d� de� � ZdS )� N)�hpy)�LveStatsPluginc �0 � e Zd Zd� Zed� � � Zd� ZdS )�LVEStatsMemoryUsagec � � t j d� � | _ d| _ d| _ d| _ t j t j � � � � | _ n<# t $ r/ d | _ | j � dt j � � Y nw xY wt � � | _ | j � � � d S )Nzplugin.LVEStatsMemoryUsager i i zCProcess attribute in psutil is not available. psutil.__version__=%s)�logging� getLogger�log�now�period� threshold�psutil�Process�os�getpid�_process�AttributeError�error�__version__r �_hpy� setrelheap)�selfs ��/builddir/build/BUILDROOT/lve-stats-4.2.10-1.el8.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/plugins/generic/lvestats_memory_usage.py�__init__zLVEStatsMemoryUsage.__init__ s� � ��$�%A�B�B������������ v�"�N�2�9�;�;�7�7�D�M�M��� v� v� v� �D�M��H�N�N�`�bh�bt�u�u�u�u�u� v���� �E�E�� �� �������s �*A �6B�Bc �F � t | � � � d� � S )N� )�str�split)�values r r zLVEStatsMemoryUsage.split s � ��5�z�z����%�%�%� c �n � | j �d S | j � � � d t d� � z }| j � t |� � � � || j k r�| j � � � d d� }| � |� � | � |j � � | � |j � � | � |j � � d�}| j � d|�� � d S || j dz k r| j � � � d S d S )Nr i � )�heap�byid�byvia�byrcszLVEStats uses too much memory)�extra� )r �memory_info�floatr �debugr r r r# r r$ r% r&