mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-04 18:25:22 +03:00
Update prometheus.py
This commit is contained in:
parent
fbc32a0da3
commit
2ea18388fa
@ -12,7 +12,13 @@ def setupRegistry() -> CollectorRegistry:
|
||||
return myregistry
|
||||
|
||||
|
||||
def add_metric(metric: GaugeMetricFamily, label: str, stats: Dict[str, Any], key: str, multiplier: float = 1.0) -> None:
|
||||
def add_metric(
|
||||
metric: GaugeMetricFamily,
|
||||
label: str,
|
||||
stats: Dict[str, Any],
|
||||
key: str,
|
||||
multiplier: float = 1.0,
|
||||
) -> None:
|
||||
try:
|
||||
string = str(stats[key])
|
||||
value = float(re.findall(r"\d+", string)[0])
|
||||
|
||||
Loading…
Reference in New Issue
Block a user