mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-06-08 17:20:22 +08:00
add FastApi实时性能监控
This commit is contained in:
@@ -494,11 +494,11 @@ class SystemUtils:
|
||||
time.sleep(1) # 等待1秒
|
||||
# 获取1秒后的网络统计
|
||||
net_io_2 = psutil.net_io_counters()
|
||||
|
||||
|
||||
# 计算1秒内的流量变化
|
||||
upload_speed = net_io_2.bytes_sent - net_io_1.bytes_sent
|
||||
download_speed = net_io_2.bytes_recv - net_io_1.bytes_recv
|
||||
|
||||
|
||||
return [upload_speed, download_speed]
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user