Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add network bandwidth usage to system table in web UI and improve reg…
…ex in get_bandwidth_stats function to include frigate detector processes
  • Loading branch information
skrashevich committed May 18, 2023
commit 5a0a9bc7b1225bc25e61f32572ebdf03500041b8
2 changes: 1 addition & 1 deletion frigate/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 2 additions & 0 deletions web/src/routes/System.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down
Loading