MCPcopy Create free account
hub / github.com/google/gopacket / decodeProcessorCounters

Function decodeProcessorCounters

layers/sflow.go:2397–2417  ·  view source on GitHub ↗
(data *[]byte)

Source from the content-addressed store, hash-verified

2395}
2396
2397func decodeProcessorCounters(data *[]byte) (SFlowProcessorCounters, error) {
2398 pc := SFlowProcessorCounters{}
2399 var cdf SFlowCounterDataFormat
2400 var high32, low32 uint32
2401
2402 *data, cdf = (*data)[4:], SFlowCounterDataFormat(binary.BigEndian.Uint32((*data)[:4]))
2403 pc.EnterpriseID, pc.Format = cdf.decode()
2404 *data, pc.FlowDataLength = (*data)[4:], binary.BigEndian.Uint32((*data)[:4])
2405
2406 *data, pc.FiveSecCpu = (*data)[4:], binary.BigEndian.Uint32((*data)[:4])
2407 *data, pc.OneMinCpu = (*data)[4:], binary.BigEndian.Uint32((*data)[:4])
2408 *data, pc.FiveMinCpu = (*data)[4:], binary.BigEndian.Uint32((*data)[:4])
2409 *data, high32 = (*data)[4:], binary.BigEndian.Uint32((*data)[:4])
2410 *data, low32 = (*data)[4:], binary.BigEndian.Uint32((*data)[:4])
2411 pc.TotalMemory = (uint64(high32) << 32) + uint64(low32)
2412 *data, high32 = (*data)[4:], binary.BigEndian.Uint32((*data)[:4])
2413 *data, low32 = (*data)[4:], binary.BigEndian.Uint32((*data)[:4])
2414 pc.FreeMemory = (uint64(high32)) + uint64(low32)
2415
2416 return pc, nil
2417}
2418
2419// SFlowEthernetFrameFlowRecord give additional information
2420// about the sampled packet if it's available.

Callers 1

decodeCounterSampleFunction · 0.85

Calls 2

decodeMethod · 0.95
SFlowCounterDataFormatTypeAlias · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…