mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 10:45:21 +03:00
Add network bandwidth usage to system table in web UI and improve regex in get_bandwidth_stats function to include frigate detector processes
This commit is contained in:
parent
5358a104a5
commit
5a0a9bc7b1
@ -864,7 +864,7 @@ 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|\/go2rtc)/([0-9]+)/", stats[0]):
|
||||
if re.search("(^ffmpeg|\/go2rtc|frigate\.detector\.[a-z]+)/([0-9]+)/", stats[0]):
|
||||
process = stats[0].split("/")
|
||||
usages[process[len(process) - 2]] = {
|
||||
"bandwidth": round(float(stats[2]), 1),
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user