MCPcopy Create free account
hub / github.com/prometheus/procfs / parseNetProtocols

Function parseNetProtocols

net_protocols.go:81–96  ·  view source on GitHub ↗
(s *bufio.Scanner)

Source from the content-addressed store, hash-verified

79}
80
81func parseNetProtocols(s *bufio.Scanner) (NetProtocolStats, error) {
82 nps := NetProtocolStats{}
83
84 // Skip the header line
85 s.Scan()
86
87 for s.Scan() {
88 line, err := nps.parseLine(s.Text())
89 if err != nil {
90 return NetProtocolStats{}, err
91 }
92
93 nps[line.Name] = *line
94 }
95 return nps, nil
96}
97
98func (ps NetProtocolStats) parseLine(rawLine string) (*NetProtocolStatLine, error) {
99 line := &NetProtocolStatLine{Capabilities: NetProtocolCapabilities{}}

Callers 1

NetProtocolsMethod · 0.85

Calls 1

parseLineMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…