parseStatm return /proc/[pid]/statm data to uint64 slice.
(data []byte)
| 79 | |
| 80 | // parseStatm return /proc/[pid]/statm data to uint64 slice. |
| 81 | func parseStatm(data []byte) ([]uint64, error) { |
| 82 | var statmSlice []uint64 |
| 83 | statmItems := strings.Fields(string(data)) |
| 84 | for i := range statmItems { |
| 85 | statmItem, err := strconv.ParseUint(statmItems[i], 10, 64) |
| 86 | if err != nil { |
| 87 | return nil, err |
| 88 | } |
| 89 | statmSlice = append(statmSlice, statmItem) |
| 90 | } |
| 91 | return statmSlice, nil |
| 92 | } |
| 93 | |
| 94 | // SizeBytes returns the process of total program size in bytes. |
| 95 | func (s ProcStatm) SizeBytes() uint64 { |
no outgoing calls
no test coverage detected
searching dependent graphs…