mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 02:35:22 +03:00
Update prometheus.py
This commit is contained in:
parent
fbc32a0da3
commit
2ea18388fa
@ -12,7 +12,13 @@ def setupRegistry() -> CollectorRegistry:
|
|||||||
return myregistry
|
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:
|
try:
|
||||||
string = str(stats[key])
|
string = str(stats[key])
|
||||||
value = float(re.findall(r"\d+", string)[0])
|
value = float(re.findall(r"\d+", string)[0])
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user