mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 10:45:21 +03:00
fix lint formatting
This commit is contained in:
parent
f42d529b68
commit
56e928e5a5
@ -118,6 +118,7 @@ async def set_cpu_stats(all_stats: dict[str, Any]) -> None:
|
||||
if cpu_stats:
|
||||
all_stats["cpu_usages"] = cpu_stats
|
||||
|
||||
|
||||
async def set_bandwidth_stats(all_stats: dict[str, Any]) -> None:
|
||||
"""Set bandwidth from nethogs."""
|
||||
bandwidth_stats = get_bandwidth_stats()
|
||||
@ -125,6 +126,7 @@ async def set_bandwidth_stats(all_stats: dict[str, Any]) -> None:
|
||||
if bandwidth_stats:
|
||||
all_stats["bandwidth_usages"] = bandwidth_stats
|
||||
|
||||
|
||||
async def set_gpu_stats(
|
||||
config: FrigateConfig, all_stats: dict[str, Any], hwaccel_errors: list[str]
|
||||
) -> None:
|
||||
|
||||
@ -843,6 +843,7 @@ def get_cpu_stats() -> dict[str, dict]:
|
||||
|
||||
return usages
|
||||
|
||||
|
||||
def get_bandwidth_stats() -> dict[str, dict]:
|
||||
"""Get bandwidth usages for each ffmpeg process id"""
|
||||
usages = {}
|
||||
@ -861,14 +862,16 @@ def get_bandwidth_stats() -> dict[str, dict]:
|
||||
for line in lines:
|
||||
stats = list(filter(lambda a: a != "", line.strip().split("\t")))
|
||||
try:
|
||||
if re.search('^ffmpeg/([0-9]+)/', stats[0]):
|
||||
if re.search("^ffmpeg/([0-9]+)/", stats[0]):
|
||||
process = stats[0].split("/")
|
||||
usages[process[1]] = {
|
||||
"bandwidth": round(float(stats[2]), 1),
|
||||
}
|
||||
except:
|
||||
continue
|
||||
return usages
|
||||
|
||||
return usages
|
||||
|
||||
|
||||
def get_amd_gpu_stats() -> dict[str, str]:
|
||||
"""Get stats using radeontop."""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user