mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 18:55:23 +03:00
Add network bandwidth usage to System table display in System.jsx and update get_bandwidth_stats function in util.py to include go2rtc processes
This commit is contained in:
parent
17e8a46c7d
commit
5794f5a01b
@ -864,9 +864,9 @@ def get_bandwidth_stats() -> dict[str, dict]:
|
|||||||
for line in lines:
|
for line in lines:
|
||||||
stats = list(filter(lambda a: a != "", line.strip().split("\t")))
|
stats = list(filter(lambda a: a != "", line.strip().split("\t")))
|
||||||
try:
|
try:
|
||||||
if re.search("^ffmpeg/([0-9]+)/", stats[0]):
|
if re.search("(^ffmpeg|\/go2rtc)/([0-9]+)/", stats[0]):
|
||||||
process = stats[0].split("/")
|
process = stats[0].split("/")
|
||||||
usages[process[1]] = {
|
usages[process[len(process)-2]] = {
|
||||||
"bandwidth": round(float(stats[2]), 1),
|
"bandwidth": round(float(stats[2]), 1),
|
||||||
}
|
}
|
||||||
except:
|
except:
|
||||||
|
|||||||
@ -428,6 +428,7 @@ export default function System() {
|
|||||||
<Th>CPU %</Th>
|
<Th>CPU %</Th>
|
||||||
<Th>Avg CPU %</Th>
|
<Th>Avg CPU %</Th>
|
||||||
<Th>Memory %</Th>
|
<Th>Memory %</Th>
|
||||||
|
<Th>Network Bandwidth</Th>
|
||||||
</Tr>
|
</Tr>
|
||||||
</Thead>
|
</Thead>
|
||||||
<Tbody>
|
<Tbody>
|
||||||
@ -436,6 +437,7 @@ export default function System() {
|
|||||||
<Td>{cpu_usages[processes[process]['pid']]?.['cpu'] || '- '}%</Td>
|
<Td>{cpu_usages[processes[process]['pid']]?.['cpu'] || '- '}%</Td>
|
||||||
<Td>{cpu_usages[processes[process]['pid']]?.['cpu_average'] || '- '}%</Td>
|
<Td>{cpu_usages[processes[process]['pid']]?.['cpu_average'] || '- '}%</Td>
|
||||||
<Td>{cpu_usages[processes[process]['pid']]?.['mem'] || '- '}%</Td>
|
<Td>{cpu_usages[processes[process]['pid']]?.['mem'] || '- '}%</Td>
|
||||||
|
<Td>{bandwidth_usages[processes[process]['pid']]?.['bandwidth'] || '- '}KB/s</Td>
|
||||||
</Tr>
|
</Tr>
|
||||||
</Tbody>
|
</Tbody>
|
||||||
</Table>
|
</Table>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user