관리-도구
편집 파일: platform_collector.cpython-38.pyc
U .?�fW � @ sZ d dl Zd dlmZmZmZ ddlmZmZ ddl m Z mZmZ G dd� de �Z e � ZdS )� N)�Any�Iterable�Optional� )�GaugeMetricFamily�Metric)� Collector�CollectorRegistry�REGISTRYc @ s\ e Zd ZdZedfee ee d�dd�Ze e d�dd�Zed d � �Z dd� Zd d� ZdS )�PlatformCollectorz)Collector for python platform informationN)�registry�platformc C s^ |d krt n|| _| �� }| j�� }|dkr:|�| �� � | �dd|�g| _|rZ|�| � d S )N�JavaZpython_infozPython platform information) �pf� _platform�_info�system�update�_java�_add_metric�_metrics�register)�selfr r �infor � r �R/opt/hc_python/lib/python3.8/site-packages/prometheus_client/platform_collector.py�__init__ s �zPlatformCollector.__init__)�returnc C s | j S )N)r )r r r r �collect s zPlatformCollector.collectc s8 � � � }� fdd�|D �}t| ||d�}|�|d� |S )Nc s g | ]}� | �qS r r )�.0�k��datar r � <listcomp> s z1PlatformCollector._add_metric.<locals>.<listcomp>)�labelsr )�keysr Z add_metric)�name� documentationr"