SILENT KILLERPanel

Current Path: > > opt > cloudlinux > venv > lib64 > python3.11 > > site-packages > prometheus_client >


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //opt/cloudlinux/venv/lib64/python3.11//site-packages/prometheus_client/

NameTypeSizeLast ModifiedActions
__pycache__ Directory - -
bridge Directory - -
openmetrics Directory - -
twisted Directory - -
__init__.py File 1817 bytes April 17 2025 13:10:58.
asgi.py File 1185 bytes April 17 2025 13:10:58.
context_managers.py File 1691 bytes April 17 2025 13:10:58.
core.py File 895 bytes April 17 2025 13:10:58.
decorator.py File 15802 bytes April 17 2025 13:10:58.
exposition.py File 15283 bytes April 17 2025 13:10:58.
gc_collector.py File 1458 bytes April 17 2025 13:10:58.
metrics.py File 22184 bytes April 17 2025 13:10:58.
metrics_core.py File 11881 bytes April 17 2025 13:10:58.
mmap_dict.py File 5264 bytes April 17 2025 13:10:58.
multiprocess.py File 6474 bytes April 17 2025 13:10:58.
parser.py File 7256 bytes April 17 2025 13:10:58.
platform_collector.py File 1735 bytes April 17 2025 13:10:58.
process_collector.py File 3654 bytes April 17 2025 13:10:58.
registry.py File 5357 bytes April 17 2025 13:10:58.
samples.py File 1358 bytes April 17 2025 13:10:58.
utils.py File 621 bytes April 17 2025 13:10:58.
values.py File 3836 bytes April 17 2025 13:10:58.

Reading File: //opt/cloudlinux/venv/lib64/python3.11//site-packages/prometheus_client//gc_collector.py

from __future__ import unicode_literals

import gc
import platform

from .metrics_core import CounterMetricFamily
from .registry import REGISTRY


class GCCollector(object):
    """Collector for Garbage collection statistics."""

    def __init__(self, registry=REGISTRY):
        if not hasattr(gc, 'get_stats') or platform.python_implementation() != 'CPython':
            return
        registry.register(self)

    def collect(self):
        collected = CounterMetricFamily(
            'python_gc_objects_collected',
            'Objects collected during gc',
            labels=['generation'],
        )
        uncollectable = CounterMetricFamily(
            'python_gc_objects_uncollectable',
            'Uncollectable object found during GC',
            labels=['generation'],
        )

        collections = CounterMetricFamily(
            'python_gc_collections',
            'Number of times this generation was collected',
            labels=['generation'],
        )

        for generation, stat in enumerate(gc.get_stats()):
            generation = str(generation)
            collected.add_metric([generation], value=stat['collected'])
            uncollectable.add_metric([generation], value=stat['uncollectable'])
            collections.add_metric([generation], value=stat['collections'])

        return [collected, uncollectable, collections]


GC_COLLECTOR = GCCollector()
"""Default GCCollector in default Registry REGISTRY."""

SILENT KILLER Tool