| Current Path : /lib/fm-agent/library/__pycache__/ |
| Current File : //lib/fm-agent/library/__pycache__/threshold.cpython-36.pyc |
3 q��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 j| jj�| _|jd�| _|jdd�| _|jdd�| _|jdd �| _ 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 j|� tj| jj�| _d S )N)r �updater r r r r )r r r r r �__setstate__ s zThreshold.__setstate__c C sP | j d kr| jjd| j� d S tt | j �}| jjd|| 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