Fix /proc/net/dev column parsing.

This fixes https://github.com/prometheus/node_exporter/issues/73
This commit is contained in:
Julius Volz 2015-05-21 00:34:24 +02:00
commit 072ddabf62
3 changed files with 13 additions and 2 deletions

View file

@ -21,6 +21,10 @@ func TestNetDevStats(t *testing.T) {
t.Errorf("want netstat wlan0 bytes %s, got %s", want, got)
}
if want, got := "68210035552", netStats["receive"]["eth0"]["bytes"]; want != got {
t.Errorf("want netstat eth0 bytes %s, got %s", want, got)
}
if want, got := "934", netStats["transmit"]["tun0"]["packets"]; want != got {
t.Errorf("want netstat tun0 packets %s, got %s", want, got)
}