mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 18:55:23 +03:00
Add option for network bandwidth and only calculate if enabled
This commit is contained in:
parent
8d941e5e26
commit
21abed53c1
@ -94,6 +94,7 @@ class TelemetryConfig(FrigateBaseModel):
|
|||||||
default=["eth", "enp", "eno", "ens", "wl", "lo"],
|
default=["eth", "enp", "eno", "ens", "wl", "lo"],
|
||||||
title="Enabled network interfaces for bandwidth calculation.",
|
title="Enabled network interfaces for bandwidth calculation.",
|
||||||
)
|
)
|
||||||
|
network_bandwidth: bool = Field(default=False, title="Enable network bandwidth for ffmpeg processes.")
|
||||||
version_check: bool = Field(default=True, title="Enable latest version check.")
|
version_check: bool = Field(default=True, title="Enable latest version check.")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -104,13 +104,15 @@ def get_processing_stats(
|
|||||||
"""Get stats for cpu / gpu."""
|
"""Get stats for cpu / gpu."""
|
||||||
|
|
||||||
async def run_tasks() -> None:
|
async def run_tasks() -> None:
|
||||||
await asyncio.wait(
|
stats_tasks = [
|
||||||
[
|
asyncio.create_task(set_gpu_stats(config, stats, hwaccel_errors)),
|
||||||
asyncio.create_task(set_gpu_stats(config, stats, hwaccel_errors)),
|
asyncio.create_task(set_cpu_stats(stats)),
|
||||||
asyncio.create_task(set_cpu_stats(stats)),
|
]
|
||||||
asyncio.create_task(set_bandwidth_stats(config, stats)),
|
|
||||||
]
|
if config.telemetry.network_bandwidth:
|
||||||
)
|
stats_tasks.append(asyncio.create_task(set_bandwidth_stats(config, stats)))
|
||||||
|
|
||||||
|
await asyncio.wait(stats_tasks)
|
||||||
|
|
||||||
loop = asyncio.new_event_loop()
|
loop = asyncio.new_event_loop()
|
||||||
asyncio.set_event_loop(loop)
|
asyncio.set_event_loop(loop)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user