forget to implements String()
This commit is contained in:
parent
8098298111
commit
b6b79b5b38
4
net.go
4
net.go
|
@ -31,12 +31,12 @@ type NetConnectionStat struct {
|
|||
Pid int32 `json:"pid"`
|
||||
}
|
||||
|
||||
func (n NetConnectionStat) String() string {
|
||||
func (n NetIOCountersStat) String() string {
|
||||
s, _ := json.Marshal(n)
|
||||
return string(s)
|
||||
}
|
||||
|
||||
func (n NetIOCountersStat) String() string {
|
||||
func (n NetConnectionStat) String() string {
|
||||
s, _ := json.Marshal(n)
|
||||
return string(s)
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -26,6 +27,10 @@ type MemoryInfoExStat struct {
|
|||
Data uint64 `json:"data"` // bytes
|
||||
Dirty uint64 `json:"dirty"` // bytes
|
||||
}
|
||||
func (m MemoryInfoExStat) String() string {
|
||||
s, _ := json.Marshal(m)
|
||||
return string(s)
|
||||
}
|
||||
|
||||
type MemoryMapsStat struct {
|
||||
Path string `json:"path"`
|
||||
|
@ -41,6 +46,13 @@ type MemoryMapsStat struct {
|
|||
Swap uint64 `json:"swap"`
|
||||
}
|
||||
|
||||
func (m MemoryMapsStat) String() string {
|
||||
s, _ := json.Marshal(m)
|
||||
return string(s)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Create new Process instance
|
||||
// This only stores Pid
|
||||
func NewProcess(pid int32) (*Process, error) {
|
||||
|
|
Loading…
Reference in New Issue