관리-도구
편집 파일: gc_collector.cpython-38.pyc
U .?�f� � @ sZ d dl Z d dlZd dlmZ ddlmZmZ ddlmZm Z m Z G dd� de�Ze� ZdS )� N)�Iterable� )�CounterMetricFamily�Metric)� Collector�CollectorRegistry�REGISTRYc @ s4 e Zd ZdZefed�dd�Zee d�dd�Z dS ) �GCCollectorz,Collector for Garbage collection statistics.)�registryc C s( t td�rt�� dkrd S |�| � d S )N� get_stats�CPython)�hasattr�gc�platform�python_implementation�register)�selfr � r �L/opt/hc_python/lib/python3.8/site-packages/prometheus_client/gc_collector.py�__init__ s zGCCollector.__init__)�returnc C s� t dddgd�}t dddgd�}t dddgd�}tt�� �D ]L\}}t|�}|j|g|d d � |j|g|d d � |j|g|d d � q<|||gS ) NZpython_gc_objects_collectedzObjects collected during gc� generation)�labelsZpython_gc_objects_uncollectablez%Uncollectable objects found during GCZpython_gc_collectionsz-Number of times this generation was collected� collected)�value� uncollectable�collections)r � enumerater r �strZ add_metric)r r r r �gen�statr r r r �collect s* ���zGCCollector.collectN) �__name__� __module__�__qualname__�__doc__r r r r r r! r r r r r s r ) r r �typingr Zmetrics_corer r r r r r r ZGC_COLLECTORr r r r �<module> s #