Skip to content

NVR with realtime local object detection for IP cameras

Add go2rtc & remote detectors network bandwidth usage to System table (#6526)

Sergey Krashevich6d0c2ec5c877
diff --git a/frigate/util.py b/frigate/util.py
index f82476ebc6..47b7b43230 100755
--- a/frigate/util.py
+++ b/frigate/util.py
@@ -864,10 +864,12 @@ 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|\/go2rtc|frigate\.detector\.[a-z]+)/([0-9]+)/", stats[0]
+ ):
process = stats[0].split("/")
- usages[process[1]] = {
- "bandwidth": round(float(stats[2]), 1),
+ usages[process[len(process) - 2]] = {
+ "bandwidth": round(float(stats[1]) + float(stats[2]), 1),
}
except:
continue
diff --git a/web/src/routes/System.jsx b/web/src/routes/System.jsx
index 8d5c4ef80b..012d1be03a 100644
--- a/web/src/routes/System.jsx
+++ b/web/src/routes/System.jsx
@@ -239,6 +239,7 @@ export default function System() {
<Th>Inference Speed</Th>
<Th>CPU %</Th>
<Th>Memory %</Th>
+ <Th>Network Bandwidth</Th>
</Tr>
</Thead>
<Tbody>
@@ -247,6 +248,7 @@ export default function System() {
<Td>{detectors[detector]['inference_speed']} ms</Td>
<Td>{cpu_usages[detectors[detector]['pid']]?.['cpu'] || '- '}%</Td>
<Td>{cpu_usages[detectors[detector]['pid']]?.['mem'] || '- '}%</Td>
+ <Td>{bandwidth_usages[detectors[detector]['pid']]?.['bandwidth'] || '- '}KB/s</Td>
</Tr>
</Tbody>
</Table>
@@ -428,6 +430,7 @@ export default function System() {
<Th>CPU %</Th>
<Th>Avg CPU %</Th>
<Th>Memory %</Th>
+ <Th>Network Bandwidth</Th>
</Tr>
</Thead>
<Tbody>
@@ -436,6 +439,7 @@ export default function System() {
<Td>{cpu_usages[processes[process]['pid']]?.['cpu'] || '- '}%</Td>
<Td>{cpu_usages[processes[process]['pid']]?.['cpu_average'] || '- '}%</Td>
<Td>{cpu_usages[processes[process]['pid']]?.['mem'] || '- '}%</Td>
+ <Td>{bandwidth_usages[processes[process]['pid']]?.['bandwidth'] || '- '}KB/s</Td>
</Tr>
</Tbody>
</Table>