smart-test-ti / SoloX

💯SoloX - Real-time collection tool for Android/iOS performance data.(Android性能测试android performance\iOS性能测试ios performance\移动端性能测试mobile performance\APP性能测试app performance\app性能测试工具)
https://smart-test-ti.github.io/solox
MIT License
994 stars 177 forks source link

[BUG]流量统计不准确 #76

Closed seveneven closed 2 years ago

seveneven commented 2 years ago

1.通过与PerfDog相对比验证发现流量统计不准确,原本耗费360MB左右流量,实际统计结果为278MB左右。

rafa0128 commented 2 years ago

1.通过与PerfDog相对比验证发现流量统计不准确,原本耗费360MB左右流量,实际统计结果为278MB左右。

这个会有误差,想减小误差就只勾选流量进行收集,统计所有指标的话,你的电脑设备低配的话,跑起来收集慢,有可能10秒才收集一次,长时间下来就会漏掉很多秒的数据

seveneven commented 1 year ago

/proc/{pid}/net/dev 获取的是当前总流量,那么在start的时候记录下当前上传和下载流量值,在结束时再记录下当前值,用这两个值相减应该可以得到较为准确的流量消耗。