change NumCtxSwitchesStat fields to int64

This commit is contained in:
Nikolay Sivko 2014-09-13 00:29:54 +04:00
parent 5a0ed0e6df
commit 9e3563f8ca
2 changed files with 6 additions and 6 deletions

View File

@ -38,8 +38,8 @@ type IOCountersStat struct {
}
type NumCtxSwitchesStat struct {
Voluntary int32 `json:"voluntary"`
Involuntary int32 `json:"involuntary"`
Voluntary int64 `json:"voluntary"`
Involuntary int64 `json:"involuntary"`
}
func (p Process) String() string {

View File

@ -430,17 +430,17 @@ func (p *Process) fillFromStatus() error {
}
p.numThreads = int32(v)
case "voluntary_ctxt_switches":
v, err := strconv.ParseInt(value, 10, 32)
v, err := strconv.ParseInt(value, 10, 64)
if err != nil {
return err
}
p.numCtxSwitches.Voluntary = int32(v)
p.numCtxSwitches.Voluntary = v
case "nonvoluntary_ctxt_switches":
v, err := strconv.ParseInt(value, 10, 32)
v, err := strconv.ParseInt(value, 10, 64)
if err != nil {
return err
}
p.numCtxSwitches.Involuntary = int32(v)
p.numCtxSwitches.Involuntary = v
}
}
return nil