Skip to content

Commit

Permalink
Merge e70f55a into 98a0b4b
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed Mar 9, 2018
2 parents 98a0b4b + e70f55a commit 6d12701
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ func (t *tcParser) parseData(cmdOutput string, ifaceName string, reHeader, reDat
haveData = false

// tcName is the internal name for this Qdisc / Class on an interface. Example: "eth0:2:3" is Class 3, Qdisc 2 on interface eth0.
tcName := fmt.Sprintf("%s:%s:%s", ifaceName, strconv.FormatInt(qdiscHandle, 10), strconv.FormatInt(classHandle, 10))
tcName := fmt.Sprintf("%s:%s:%s", ifaceName, strconv.FormatInt(qdiscHandle, 16), strconv.FormatInt(classHandle, 16))
data := &parsedData{
name: tcName,
sentBytes: sentBytes,
Expand Down
22 changes: 11 additions & 11 deletions lib/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,13 +390,13 @@ func TestTcParserParse(t *testing.T) {
[]parsedData{
{"eth0:1:0", 12548819, 124105, 13, 25, nil},
{"eth0:2:0", 12548819, 24106, 128, 29, nil},
{"eth0:10:0", 123432, 1027, 11, 2048, nil},
{"eth0:110:0", 9397865, 102745, 0, 0, nil},
{"eth0:a:0", 123432, 1027, 11, 2048, nil},
{"eth0:6e:0", 9397865, 102745, 0, 0, nil},
{"eth0:2:1", 931528, 9571, 127, 25, nil},
{"eth0:2:2", 11630676, 114607, 13, 5211, nil},
{"eth0:4:1", 11601665, 114364, 0, 0, nil},
{"eth0:4:10", 1096857, 7059, 0, 0, nil},
{"eth0:4:110", 256, 13, 7, 0, nil},
{"eth0:4:a", 1096857, 7059, 0, 0, nil},
{"eth0:4:6e", 256, 13, 7, 0, nil},
},
1,
1,
Expand All @@ -410,22 +410,22 @@ func TestTcParserParse(t *testing.T) {
nil,
nil,
map[string]userClass{
"eth0:4:1": {0, "username"},
"eth0:4:10": {1, "username"},
"eth0:4:1": {0, "username"},
"eth0:4:a": {1, "username"},
},
"",
[]parsedData{
{"eth0:1:0", 12548819, 124105, 13, 25, nil},
{"eth0:2:0", 12548819, 24106, 128, 29, nil},
{"eth0:10:0", 123432, 1027, 11, 2048, nil},
{"eth0:110:0", 9397865, 102745, 0, 0, nil},
{"eth0:a:0", 123432, 1027, 11, 2048, nil},
{"eth0:6e:0", 9397865, 102745, 0, 0, nil},
{"eth0:2:1", 931528, 9571, 127, 25, nil},
{"eth0:2:2", 11630676, 114607, 13, 5211, nil},
{"eth0:4:1", 11601665, 114364, 0, 0, nil},
{"eth0:4:1", 11601665, 114364, 0, 0, &userClass{0, "username"}},
{"eth0:4:10", 1096857, 7059, 0, 0, nil},
{"eth0:4:10", 1096857, 7059, 0, 0, &userClass{1, "username"}},
{"eth0:4:110", 256, 13, 7, 0, nil},
{"eth0:4:a", 1096857, 7059, 0, 0, nil},
{"eth0:4:a", 1096857, 7059, 0, 0, &userClass{1, "username"}},
{"eth0:4:6e", 256, 13, 7, 0, nil},
},
1,
1,
Expand Down

0 comments on commit 6d12701

Please sign in to comment.