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
Next Next commit
Add network bandwidth usage to System table display in System.jsx and…
… update get_bandwidth_stats function in util.py to include go2rtc processes
  • Loading branch information
skrashevich committed May 18, 2023
commit 5794f5a01bc4af75b8eb1ea897a0e3259fbca4b7
4 changes: 2 additions & 2 deletions frigate/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,9 +864,9 @@ 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)/([0-9]+)/", stats[0]):
process = stats[0].split("/")
usages[process[1]] = {
usages[process[len(process)-2]] = {
"bandwidth": round(float(stats[2]), 1),
}
except:
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 @@ -428,6 +428,7 @@ export default function System() {
<Th>CPU %</Th>
<Th>Avg CPU %</Th>
<Th>Memory %</Th>
<Th>Network Bandwidth</Th>
</Tr>
</Thead>
<Tbody>
Expand All @@ -436,6 +437,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>
Expand Down
Loading