OwlCyberSecurity - MANAGER
Edit File: process_collector.cpython-311.pyc
� ������hF����������������������������d�dl�mZ�d�dlZddlmZmZ�ddlmZ� �d�dlZ�ej ����������������������Z n #�e$�r�dZ Y�nw�xY�w�G�d��de������������Z �e ��������������ZdS�) �����)�unicode_literalsN����)�CounterMetricFamily�GaugeMetricFamily)�REGISTRYi���c��������������������0�����e�Zd�ZdZdd��defd�Zd��Zd��ZdS�) �ProcessCollectorz6Collector for Standard Exports such as cpu and memory.��c������������������������dS�)N�self��r ���������t/builddir/build/BUILD/cloudlinux-venv-1.0.8/venv/lib/python3.11/site-packages/prometheus_client/process_collector.py�<lambda>zProcessCollector.<lambda>���s��������r���z/procc����������������������||�_���������||�_��������||�_��������|r|dz���|�_��������nd|�_��������d|�_�������� �t����������j��������d������������|�_��������n##�t����������t����������t����������t����������f$�r�Y�nw�xY�wt����������|�_��������d|�_ �������� �|������������������������������������|�_ ��������n#�t����������$�r�Y�nw�xY�w|r|���������������������|��������������d�S�d�S�)N� _process_�process_g������Y@� SC_CLK_TCKr���)� _namespace�_pid�_proc�_prefix�_ticks�os�sysconf� ValueError� TypeError�AttributeError�OSError� _PAGESIZE� _pagesize�_btime� _boot_time�IOError�register)r���� namespace�pid�proc�registrys��� r����__init__zProcessCollector.__init__���s�������#����� ��� ��� &�$�{�2�D�L�L�%�D�L���� ��*�\�2�2�D�K�K���I�~�w�?�� �� �� ��D� �����#������� ��/�/�+�+�D�K�K���� �� �� ��D� ������ $����d�#�#�#�#�#� $�� $s#����A��A,�+A,�B�� B*�)B*c������������������>����t����������t����������j�����������������������������|�j��������d������������d������������5�}|D�]L}|���������������������d������������r5t ����������|�����������������������������������d���������������������c�cd�d�d��������������S��M �d�d�d��������������d�S�#�1�swxY�w�Y���d�S�)N�stat�rbs���btime r���)�openr����path�joinr���� startswith�float�split)r���r,����lines��� r���r#���zProcessCollector._boot_time-���s������� �"�'�,�,�t�z�6�2�2�D� 9� 9�� 2�T��� 2�� 2���?�?�9�-�-��2� ������a��1�1�1�1� 2�� 2�� 2�� 2�� 2�� 2�� 2�� 2�2� 2� 2�� 2�� 2�� 2�� 2�� 2�� 2�� 2�� 2�� 2�� 2�� 2����� 2�� 2�� 2�� 2�� 2�� 2s����AB�B�B�Bc������������������f����|�j���������sg�S�t����������j�����������������������������|�j��������t����������|�����������������������������������������������������������������������������������������������}g�} �t����������t����������j�����������������������������|d������������d������������5�}|� ����������������������������������� ��������������������d������������d���������� ����������������������������������}d�d�d��������������n#�1�swxY�w�Y���t����������|�j��������dz���dt����������|d����������������������������������}t����������|�j��������d z���d t����������|d���������������������|�j��������z���������������}t����������|d���������������������|�j��������z��}t����������|�j��������d z���d||�j���������z����������������}t����������|d���������������������|�j��������z��} t����������|d���������������������|�j��������z��} t!����������|�j��������dz���d| | z����������������}|���������������������||||g�������������n#�t$����������$�r�Y�nw�xY�w �t����������t����������j�����������������������������|d������������d������������5�}|D�]X} | ���������������������d������������rAt����������|�j��������dz���dt����������| � ����������������������������������d����������������������������������}�n�Yd�d�d��������������n#�1�swxY�w�Y���t����������|�j��������dz���dt)����������t����������j��������t����������j�����������������������������|d������������������������������������������������}|���������������������||g�������������n#�t$����������t,����������f$�r�Y�nw�xY�w|S�)Nr,���r-�������)����virtual_memory_byteszVirtual memory size in bytes.����)�value�resident_memory_byteszResident memory size in bytes.���������start_time_secondsz6Start time of the process since unix epoch in seconds.���������cpu_seconds_totalz0Total user and system CPU time spent in seconds.�limitss ���Max open file�max_fdsz(Maximum number of open file descriptors.�����open_fdsz Number of open file descriptors.�fd)r"���r���r/���r0���r����strr����stripr.����readr3���r���r���r2���r!���r���r����extendr$���r1����len�listdirr���)r���r'����resultr,����parts�vmem�rss�start_time_secs� start_time�utime�stime�cpurB���r4���rC���rE���s��� r����collectzProcessCollector.collect3���s�������{�� ��I��g�l�l�4�:�s�4�9�9�;�;�'7�'7�'=�'=�'?�'?�@�@���� ��b�g�l�l�3��/�/��6�6�� >�$������*�*�4�0�0��4�:�:�<�<�� >�� >�� >�� >�� >�� >�� >�� >�� >�� >�� >����� >�� >�� >�� >��%�T�\�4J�%J�%D�E�RW�XZ�R[�L\�L\�^��^��^�D�#�D�L�3J�$J�Ll�*/��b� �*:�*:�T�^�*K�M��M��M�C�#�E�"�I�.�.���<�O�*�4�<�:N�+N�+c�1@�4�;�1N�P��P��P�J���%��)�$�$�t�{�2�E��%��)�$�$�t�{�2�E�%�d�l�5H�&H�&X�,1�E�M�;��;��;�C�� �M�M�4��j�#�6�7�7�7�7���� �� �� ��D� ���� ��b�g�l�l�3��1�1�4�8�8�� �F�"�����D����'7�8�8���"3�D�L�9�4L�4^�:?�� � ���Q��:P�:P�#R��#R��#R����� � �� �� �� �� �� �� �� �� �� �� ����� �� �� �� ��)��� �)B�)K�),�R�Z�����S�$�8O�8O�-P�-P�)Q�)Q�S��S�H�� �M�M�8�W�-�.�.�.�.����!�� �� �� ��D� ������ sp����#.G:��A�C�G:��C!�!G:��$C!�%DG:��: H�H�.L��9AJ!�L��!J%�%L��(J%�)A0L��L.�-L.N)�__name__� __module__�__qualname__�__doc__r���r*���r#���rV���r ���r���r���r ���r ������sX��������������@�@�!#���g�PX��$��$��$��$�22��2��2�+��+��+��+��+r���r ���)� __future__r���r����metrics_corer���r���r)���r����resource�getpagesizer ����ImportError�objectr ����PROCESS_COLLECTORr ���r���r����<module>rb������s�������'��'��'��'��'��'�� � � � ��@��@��@��@��@��@��@��@���������������O�O�O�$��$�&�&�I�I����������I�I�I����� M��M��M��M��M�v��M��M��M�`�%�$�&�&����<��<s����.��8�8