Improve power report attribution and sampling

This commit is contained in:
世界
2026-10-02 18:00:09 +08:00
parent fd9a076d25
commit eb7deeae8a
16 changed files with 588 additions and 43 deletions
+9 -2
View File
@@ -83,9 +83,16 @@ func readInterfaceCounters() map[string]interfaceCounters {
if inErr != nil || outErr != nil {
continue
}
inBytes, inBytesErr := strconv.ParseUint(fields[0], 10, 64)
outBytes, outBytesErr := strconv.ParseUint(fields[8], 10, 64)
if inBytesErr != nil || outBytesErr != nil {
continue
}
result[name] = interfaceCounters{
inPackets: uint32(inPackets),
outPackets: uint32(outPackets),
inPackets: inPackets,
outPackets: outPackets,
inBytes: inBytes,
outBytes: outBytes,
}
}
return result