File: //proc/self/root/lib/fm-agent/library/__pycache__/threshold.cpython-39.pyc
a
��i� � @ s4 d dl Z d dlZd dlZd dlZG dd� de�ZdS )� Nc @ s, e Zd Zdd� Zdd� Zdd� Zdd� Zd S )
� Thresholdc K sP t �| jj�| _|�d�| _|�dd�| _|�dd�| _|�dd �| _ d| _
d S )N�id�delayr �value�operatorF)�logging� getLogger� __class__�__name__�log�getr Zduration�limitr Zreported)�self�kwargs� r �&/usr/lib/fm-agent/library/threshold.py�__init__ s zThreshold.__init__c C s t | j�}|d= |S )Nr )�dict�__dict__�r �stater r r �__getstate__ s
zThreshold.__getstate__c C s | j �|� t�| jj�| _d S )N)r �updater r r r
r r r r r �__setstate__ s zThreshold.__setstate__c C sP | j d u r| j�d| j� d S tt | j �}| j�d|| j | j| j� ||| j�S )Nz Threshold %s is a null thresholdz9Testing if value (%.2f) is %s threshold %s's limit (%.2f))r r �debugr �getattrr
)r r Z operationr r r �limit_exceeded s
�zThreshold.limit_exceededN)r
�
__module__�__qualname__r r r r r r r r r s r )r r �sys�time�objectr r r r r �<module> s