MCPcopy
hub / github.com/vishvananda/netlink / parseTcStats

Function parseTcStats

class_linux.go:347–366  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

345}
346
347func parseTcStats(data []byte) (*ClassStatistics, error) {
348 buf := &bytes.Buffer{}
349 buf.Write(data)
350 tcStats := &tcStats{}
351 if err := binary.Read(buf, native, tcStats); err != nil {
352 return nil, err
353 }
354
355 stats := NewClassStatistics()
356 stats.Basic.Bytes = tcStats.Bytes
357 stats.Basic.Packets = tcStats.Packets
358 stats.Queue.Qlen = tcStats.Qlen
359 stats.Queue.Backlog = tcStats.Backlog
360 stats.Queue.Drops = tcStats.Drops
361 stats.Queue.Overlimits = tcStats.Overlimits
362 stats.RateEst.Bps = tcStats.Bps
363 stats.RateEst.Pps = tcStats.Pps
364
365 return stats, nil
366}
367
368func parseGnetStats(data []byte, gnetStats interface{}) error {
369 buf := &bytes.Buffer{}

Callers 2

QdiscListMethod · 0.85
ClassListMethod · 0.85

Calls 3

NewClassStatisticsFunction · 0.85
WriteMethod · 0.80
ReadMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…