관리-도구
편집 파일: metrics.cpython-311.pyc
� �܋f�V � �~ � d dl Z d dlmZ d dlZd dlZddlmZ ddlmZm Z m Z ddlmZm Z mZmZ ddlmZ ddlmZmZ e j d k r eZej Znd � Zd� Zd� Z G d � de� � Z G d� de� � Z G d� de� � Z G d� de� � Z G d� de� � Z! G d� de� � Z" G d� de� � Z#dS )� N)�Lock� )�values)�ExceptionCounter�InprogressTracker�Timer)�Metric�METRIC_LABEL_NAME_RE�METRIC_NAME_RE�RESERVED_METRIC_LABEL_NAME_RE)�REGISTRY)�floatToGoString�INF)� c �8 � t j | ||j � � S �N)�types� MethodType� __class__)�func�objs �j/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/prometheus_client/metrics.py�create_bound_methodr s � ����c�3�=�9�9�9� c � � d}|r||dz z }|r||dz z }||z }| dk r|� d� � r |d d� }|r |� d|z � � s|d|z z }|r| dv rt d|z � � �|S )N� �_�counter�_totali����)�info�statesetz2Metric name is of a type that cannot have a unit: )�endswith� ValueError)�metric_type�name� namespace� subsystem�unit� full_names r �_build_full_namer* s� � ��I�� %��Y��_�$� �� %��Y��_�$� � ���I��i���I�$6�$6�x�$@�$@���c�r�c�N� �� �I�&�&�s�T�z�2�2� ��S�4�Z�� �� [��3�3�3��M�PY�Y�Z�Z�Z��r c � � t |� � }|D ]i}t j |� � st d|z � � �t j |� � rt d|z � � �|| j v rt d|z � � ��j|S )NzInvalid label metric name: zReserved label metric name: )�tupler �matchr# r �_reserved_labelnames)�cls� labelnames�ls r �_validate_labelnamesr2 '