MCPcopy
hub / github.com/livekit/livekit / getTCStats

Function getTCStats

pkg/telemetry/prometheus/node_linux.go:26–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24)
25
26func getTCStats() (packets, drops uint32, err error) {
27 rtnl, err := tc.Open(&tc.Config{})
28 if err != nil {
29 err = fmt.Errorf("could not open rtnetlink socket: %v", err)
30 return
31 }
32 defer rtnl.Close()
33
34 qdiscs, err := rtnl.Qdisc().Get()
35 if err != nil {
36 err = fmt.Errorf("could not get qdiscs: %v", err)
37 return
38 }
39
40 for _, qdisc := range qdiscs {
41 packets = packets + qdisc.Stats.Packets
42 drops = drops + qdisc.Stats.Drops
43 }
44
45 return
46}

Callers 2

InitFunction · 0.70
GetNodeStatsFunction · 0.70

Calls 2

CloseMethod · 0.65
GetMethod · 0.45

Tested by

no test coverage detected