OXIESEC PANEL
- Current Dir:
/
/
opt
/
alt
/
python37
/
lib
/
python3.7
/
site-packages
/
prometheus_client
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
09/05/2025 09:36:16 AM
rwxr-xr-x
📄
__init__.py
1.65 KB
03/16/2023 12:56:10 PM
rw-r--r--
📁
__pycache__
-
03/16/2023 12:56:10 PM
rwxr-xr-x
📄
asgi.py
1.57 KB
03/16/2023 12:56:10 PM
rw-r--r--
📁
bridge
-
03/16/2023 12:56:10 PM
rwxr-xr-x
📄
context_managers.py
2.33 KB
03/16/2023 12:56:10 PM
rw-r--r--
📄
core.py
860 bytes
03/16/2023 12:56:10 PM
rw-r--r--
📄
decorator.py
15.43 KB
03/16/2023 12:56:10 PM
rw-r--r--
📄
exposition.py
23.23 KB
03/16/2023 12:56:10 PM
rw-r--r--
📄
gc_collector.py
1.48 KB
03/16/2023 12:56:10 PM
rw-r--r--
📄
metrics.py
25.53 KB
03/16/2023 12:56:10 PM
rw-r--r--
📄
metrics_core.py
15.18 KB
03/16/2023 12:56:10 PM
rw-r--r--
📄
mmap_dict.py
5.21 KB
03/16/2023 12:56:10 PM
rw-r--r--
📄
multiprocess.py
6.88 KB
03/16/2023 12:56:10 PM
rw-r--r--
📁
openmetrics
-
03/16/2023 12:56:10 PM
rwxr-xr-x
📄
parser.py
6.94 KB
03/16/2023 12:56:10 PM
rw-r--r--
📄
platform_collector.py
1.83 KB
03/16/2023 12:56:10 PM
rw-r--r--
📄
process_collector.py
3.75 KB
03/16/2023 12:56:10 PM
rw-r--r--
📄
py.typed
0 bytes
03/16/2023 12:56:10 PM
rw-r--r--
📄
registry.py
6.05 KB
03/16/2023 12:56:10 PM
rw-r--r--
📄
samples.py
1.48 KB
03/16/2023 12:56:10 PM
rw-r--r--
📁
twisted
-
03/16/2023 12:56:10 PM
rwxr-xr-x
📄
utils.py
594 bytes
03/16/2023 12:56:10 PM
rw-r--r--
📄
values.py
4.72 KB
03/16/2023 12:56:10 PM
rw-r--r--
Editing: gc_collector.py
Close
import gc import platform from typing import Iterable from .metrics_core import CounterMetricFamily, Metric from .registry import Collector, CollectorRegistry, REGISTRY class GCCollector(Collector): """Collector for Garbage collection statistics.""" def __init__(self, registry: CollectorRegistry = REGISTRY): if not hasattr(gc, 'get_stats') or platform.python_implementation() != 'CPython': return registry.register(self) def collect(self) -> Iterable[Metric]: 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 gen, stat in enumerate(gc.get_stats()): generation = str(gen) 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."""