HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib/python3.10/site-packages/flower/__pycache__/inspector.cpython-310.pyc
o

/we��@s@ddlZddlZddlZddlmZe�e�ZGdd�d�ZdS)�N)�partialc@s2eZdZdZdd�Zddd�Zdd�Zd	d
�ZdS)�	Inspector)�stats�
active_queues�
registered�	scheduled�active�reserved�revoked�confcCs"||_||_||_t�t�|_dS�N)�io_loop�capp�timeout�collections�defaultdict�dict�workers)�selfr
rr�r�I/home/arjun/projects/env/lib/python3.10/site-packages/flower/inspector.py�__init__
szInspector.__init__Nc
Cs2g}|jD]}|�|j�dt|j||���q|Sr)�methods�appendr
�run_in_executorr�_inspect)r�
workername�feutures�methodrrr�inspects
 zInspector.inspectcCs"|j|}|||<t��|d<dS)N�	timestamp)r�time)rrr�response�inforrr�
_on_updates
zInspector._on_updatec	Cs�|r|gnd}|jjj|j|d�}t�d|�t��}|dkr%t||��nt||�dd�}t�d|t��|�|dus@d|vrHt�d|�dS|�	�D]\}}|dur`|j
�t|j
|||��qLdS)	N)r�destinationzSending %s inspect commandrT)�safez)Inspect command %s took %.2fs to complete�errorzInspect method %s failed)r�controlrr�logger�debugr!�getattr�warning�itemsr
�add_callbackrr$)	rrrr%r�start�result�workerr"rrrrs"����zInspector._inspectr)�__name__�
__module__�__qualname__rrrr$rrrrrr	s
r)	r�loggingr!�	functoolsr�	getLoggerr2r)rrrrr�<module>s