관리-도구
편집 파일: platform_collector.cpython-311.pyc
� �܋f� � �b � d dl mZ d dlZddlmZ ddlmZ G d� de� � Z e � � Z dS )� )�unicode_literalsN� )�GaugeMetricFamily)�REGISTRYc �F � e Zd ZdZedfd�Zd� Zed� � � Zd� Z d� Z dS )�PlatformCollectorz)Collector for python platform informationNc �F � |�t n|| _ | � � � }| j � � � }|dk r'|� | � � � � � | � dd|� � g| _ |r|� | � � d S d S )N�Java�python_infozPython platform information) �pf� _platform�_info�system�update�_java�_add_metric�_metrics�register)�self�registry�platform�infor s �u/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/prometheus_client/platform_collector.py�__init__zPlatformCollector.__init__ s� � �'�/���X����z�z�|�|����&�&�(�(���V����K�K�� � ���%�%�%����]�,I�4�P�P� �� � � $����d�#�#�#�#�#� $� $� c � � | j S )N)r )r s r �collectzPlatformCollector.collect s � ��}�r c � �� �� � � }�fd�|D � � }t | ||�� � }|� |d� � |S )Nc � �� g | ] }�| ��S � r )�.0�k�datas �r � <listcomp>z1PlatformCollector._add_metric.<locals>.<listcomp> s �� �*�*�*�a�$�q�'�*�*�*r )�labelsr )�keysr � add_metric)�name� documentationr# r% �values�gs ` r r zPlatformCollector._add_metric sV �� �������*�*�*�*�6�*�*�*���d�M�&�A�A�A�� ���V�Q�����r c � � | j � � � \ }}}| j � � � | j � � � |||d�S )N)�version�implementation�major�minor� patchlevel)r �python_version_tuple�python_version�python_implementation)r r/ r0 r1 s r r zPlatformCollector._info$ sV � �#'�>�#F�#F�#H�#H� ��u�j��~�4�4�6�6�"�n�B�B�D�D���$� � � r c �X � | j � � � \ }}}}|\ }}}||||d�S )N)�jvm_version�jvm_release� jvm_vendor�jvm_name)r �java_ver)r �java_version�_�vminfo�osinfo�vm_name� vm_release� vm_vendors r r zPlatformCollector._java. sE � �*.�.�*A�*A�*C�*C�'��a���)/�&���Y�'�%�#�� � � r )�__name__� __module__�__qualname__�__doc__r r r �staticmethodr r r r r r r r s{ � � � � � �3�3� (�4� $� $� $� $�� � � �� � �\�� � � � � � � � r r )� __future__r r r �metrics_corer r r �objectr �PLATFORM_COLLECTORr r r �<module>rK s� �� '� '� '� '� '� '� � � � � +� +� +� +� +� +� � � � � � �, � , � , � , � , �� , � , � , �^ '�&�(�(� � 4� 4r