յJ0 (^ d dl mZ d dlmZ d dlZd dlZd dlZddlmZ ddl m Z ddlmZ ddl mZ e n # e$ r eZY nw xY wd Z G d de Zd dZdS ) )unicode_literals)defaultdictN )Metric) MmapedDict)Sample)floatToGoStringzMultiprocess metricc d e Zd ZdZd dZed d Zed Zed Zd Z dS )MultiProcessCollectorz+Collector for files for multi-process mode.Nc |t j d }|rt j | st d || _ |r| | d S d S )Nprometheus_multiproc_dirz:env prometheus_multiproc_dir is not set or not a directory)osenvirongetpathisdir ValueError_pathregister)selfregistryr s p/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/prometheus_client/multiprocess.py__init__zMultiProcessCollector.__init__ s| <:>>"<==D [27==.. [YZZZ $d##### $ $ Tc l t | }t || S )zMerge metrics from given mmap files. By default, histograms are accumulated, as per prometheus wire format. But if writing the merged data back to mmap files, use accumulate=False to avoid compound accumulation. )r _read_metrics_accumulate_metrics)files accumulatemetricss r mergezMultiProcessCollector.merge! s- (55e<<$88*MMMr c P i }i fd}| D ]}t j | d }|d } t j | }n!# t $ r |dk r|d dv rY o w xY w|D ]\ }}} || \ } }}} | | }|t | t | }||| <