提交 9e3563f8 编写于 作者: N Nikolay Sivko

change NumCtxSwitchesStat fields to int64

上级 5a0ed0e6
......@@ -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 {
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册