Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
兄弟, 修改了一共两个文件 ifstat.go 和 ifstat_snmpwalk.go。
最关键的是 关于strconv的方法, 对于流量、组播、广播计数的类型,snmp表示是 COUNTER64,但是对于 discards和errors丢包,snmp表示是 COUNTER32。 前者对应于go是 ParseUint64,对于后者则是 Atoi。
这个地方卡了我很长时间,在V2EX里面也提问了http://v2ex.com/t/290255。 最后是通过reflect打印日志,看看到底是啥, 发现go识别 COUNTER32是 int。
我开发经验少,还不如三脚猫, 代码里面修改的可能会有些乱,还望兄弟包涵。
大家一起努力。 加油~
By LeEco bigdata-ops Team