Your IP : 216.73.216.86


Current Path : /lib/fm-agent/library/__pycache__/
Upload File :
Current File : //lib/fm-agent/library/__pycache__/result_queue.cpython-36.pyc

3

q��i��@sGdd�de�ZdS)c@sTeZdZdZddd�Zdd�Zdd�Zdd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�ResultQueuez�If the aggregator can't be reached for some reason, we want
    to still keep calculating results and store them locally until we can reach the agg
    again.NcCs6g|_||_|jdkrd|_||_|jdkr2d|_dS)Ni�Ii')�data�queue_max_results�queue_batch_size)�selfrr�r�)/usr/lib/fm-agent/library/result_queue.py�__init__
s

zResultQueue.__init__cCs|jjd�dS)N�)r�pop)rrrrr
szResultQueue.popcCs|jj�dS)N)rr
)rrrr�
pop_latestszResultQueue.pop_latestcCsZ|dkr|j}t|j�|kr*|j}g|_n,t|j�|}|j|d�}|jd|�|_|S)N)r�lenr)r�chunk�result�xrrr�pop_resultsszResultQueue.pop_resultscCs(t|j�|jkr|j�|jj|�dS)N)rrrr
�append)rrrrr�push*szResultQueue.pushcCsbt|�t|j�|jkr&|jj|�n8|jt|j�}t|�|}|j|d�|_|jj|�dS)N)rrr�extend)r�resultsZ
free_spaceZremovalrrr�update/szResultQueue.updatecCst|j�dkS)Nr	)rr)rrrr�isEmpty9szResultQueue.isEmptycCs
t|j�S)N)rr)rrrr�queueLength<szResultQueue.queueLength)NN)N)�__name__�
__module__�__qualname__�__doc__rr
rrrrrrrrrrrs
	

rN)�objectrrrrr�<module>s