Skip to content

Commit

Permalink
Add queue length/backlog stats
Browse files Browse the repository at this point in the history
  • Loading branch information
fach committed Jun 2, 2020
1 parent b82c767 commit 7cc7c96
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions get.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ type QdiscInfo struct {
GcFlows uint64
Throttled uint64
FlowsPlimit uint64
Qlen uint32
Backlog uint32
}

func parseTCAStats(attr netlink.Attribute) TC_Stats {
Expand Down Expand Up @@ -237,13 +239,17 @@ func parseMessage(msg netlink.Message) (QdiscInfo, error) {
// requeues only available in TCA_STATS2, not in TCA_STATS
m.Requeues = s2.Requeues
m.Overlimits = s2.Overlimits
m.Qlen = s2.Qlen
m.Backlog = s2.Backlog
case TCA_STATS:
// Legacy
s = parseTCAStats(attr)
m.Bytes = s.Bytes
m.Packets = s.Packets
m.Drops = s.Drops
m.Overlimits = s.Overlimits
m.Qlen = s.Qlen
m.Backlog = s.Backlog
default:
// TODO: TCA_OPTIONS and TCA_XSTATS
}
Expand Down

0 comments on commit 7cc7c96

Please sign in to comment.