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

stat_client.py 返回的丢包率数据有问题,对小数点后的数字没有格式化 #119

Closed
Erica-Iris opened this issue Dec 9, 2022 · 1 comment · Fixed by #120

Comments

@Erica-Iris
Copy link

已有的issues都看了,没看到类似的问题,如有重复,麻烦作者删除此issues

我的配置

❯ vnstat -v
vnStat 2.6 by Teemu Toivola <tst at iki dot fi>

文件 client/src/stat_client.py

if packet_queue.qsize() > 30:
    G_LOST_RATE[mark] = float(packet_lost) / packet_queue.qsize()

返回的数据没有去掉小数点后的数字

现象

bug

bug1

我改了一下代码

if packet_queue.qsize() > 30:
    packet_lost_rate = float(packet_lost) / packet_queue.qsize()
    G_LOST_RATE[mark] = round(packet_lost_rate,2)
@zdz
Copy link
Owner

zdz commented Dec 9, 2022

赞,可以提个 PR !

@zdz zdz linked a pull request Dec 10, 2022 that will close this issue
@zdz zdz closed this as completed in #120 Dec 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants