|
|
@ -117,11 +117,13 @@ func parseSockStats(r io.Reader, fileName string) (map[string]map[string]string,
|
|
|
|
sockStat["TCP"]["mem_bytes"] = strconv.Itoa(pageCount * pageSize)
|
|
|
|
sockStat["TCP"]["mem_bytes"] = strconv.Itoa(pageCount * pageSize)
|
|
|
|
|
|
|
|
|
|
|
|
// Update the UDP mem from page count to bytes.
|
|
|
|
// Update the UDP mem from page count to bytes.
|
|
|
|
pageCount, err = strconv.Atoi(sockStat["UDP"]["mem"])
|
|
|
|
if udpMem := sockStat["UDP"]["mem"]; udpMem != "" {
|
|
|
|
if err != nil {
|
|
|
|
pageCount, err = strconv.Atoi(udpMem)
|
|
|
|
return nil, fmt.Errorf("invalid value %s in sockstats: %s", sockStat["UDP"]["mem"], err)
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return nil, fmt.Errorf("invalid value %s in sockstats: %s", sockStat["UDP"]["mem"], err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
sockStat["UDP"]["mem_bytes"] = strconv.Itoa(pageCount * pageSize)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sockStat["UDP"]["mem_bytes"] = strconv.Itoa(pageCount * pageSize)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return sockStat, nil
|
|
|
|
return sockStat, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|