Closed seveneven closed 2 years ago
1.通过与PerfDog相对比验证发现流量统计不准确,原本耗费360MB左右流量,实际统计结果为278MB左右。
这个会有误差,想减小误差就只勾选流量进行收集,统计所有指标的话,你的电脑设备低配的话,跑起来收集慢,有可能10秒才收集一次,长时间下来就会漏掉很多秒的数据
/proc/{pid}/net/dev 获取的是当前总流量,那么在start的时候记录下当前上传和下载流量值,在结束时再记录下当前值,用这两个值相减应该可以得到较为准确的流量消耗。
1.通过与PerfDog相对比验证发现流量统计不准确,原本耗费360MB左右流量,实际统计结果为278MB左右。