Skip to content

Commit 7e46b10

Browse files
committed
新增说明,比较粗糙不建议更新
1 parent 71cadcf commit 7e46b10

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

clients/client-linux.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Update by : https://github.com/cppla/ServerStatus, Update date: 20220530
44
# 版本:1.0.3, 支持Python版本:2.7 to 3.10
55
# 支持操作系统: Linux, OSX, FreeBSD, OpenBSD and NetBSD, both 32-bit and 64-bit architectures
6+
# ONLINE_PACKET_HISTORY_LEN, 探测间隔60s,记录24小时在线率(1440);探测间隔60s,记录7天(10080);探测时间30s,记录24小时(2880)
67
# 说明: 默认情况下修改server和user就可以了。丢包率监测方向可以自定义,例如:CU = "www.facebook.com"。
78

89
SERVER = "127.0.0.1"
@@ -17,6 +18,7 @@
1718
PROBEPORT = 80
1819
PROBE_PROTOCOL_PREFER = "ipv4" # ipv4, ipv6
1920
PING_PACKET_HISTORY_LEN = 100
21+
ONLINE_PACKET_HISTORY_LEN = 1440
2022
INTERVAL = 1
2123

2224
import socket
@@ -319,7 +321,7 @@ def get_realtime_data():
319321

320322
def _monitor_thread(name, host, interval, type):
321323
lostPacket = 0
322-
packet_queue = Queue(maxsize=PING_PACKET_HISTORY_LEN)
324+
packet_queue = Queue(maxsize=ONLINE_PACKET_HISTORY_LEN)
323325
while True:
324326
if name not in monitorServer.keys():
325327
monitorServer[name] = {

clients/client-psutil.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# 依赖于psutil跨平台库
55
# 版本:1.0.3, 支持Python版本:2.7 to 3.10
66
# 支持操作系统: Linux, Windows, OSX, Sun Solaris, FreeBSD, OpenBSD and NetBSD, both 32-bit and 64-bit architectures
7+
# ONLINE_PACKET_HISTORY_LEN, 探测间隔60s,记录24小时在线率(1440);探测时间60s,记录7天在线率(10080);探测时间30s,记录24小时(2880)
78
# 说明: 默认情况下修改server和user就可以了。丢包率监测方向可以自定义,例如:CU = "www.facebook.com"。
89

910
SERVER = "127.0.0.1"
@@ -18,6 +19,7 @@
1819
PROBEPORT = 80
1920
PROBE_PROTOCOL_PREFER = "ipv4" # ipv4, ipv6
2021
PING_PACKET_HISTORY_LEN = 100
22+
ONLINE_PACKET_HISTORY_LEN = 1440
2123
INTERVAL = 1
2224

2325
import socket
@@ -307,7 +309,7 @@ def get_realtime_data():
307309

308310
def _monitor_thread(name, host, interval, type):
309311
lostPacket = 0
310-
packet_queue = Queue(maxsize=PING_PACKET_HISTORY_LEN)
312+
packet_queue = Queue(maxsize=ONLINE_PACKET_HISTORY_LEN)
311313
while True:
312314
if name not in monitorServer.keys():
313315
monitorServer[name] = {

0 commit comments

Comments
 (0)