change NumCtxSwitchesStat fields to int64

pull/14/head
Nikolay Sivko 11 years ago
parent 5a0ed0e6df
commit 9e3563f8ca

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

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

Loading…
Cancel
Save