From 9e3563f8ca87123bfb7d5f4189b4a37cedecb270 Mon Sep 17 00:00:00 2001 From: Nikolay Sivko Date: Sat, 13 Sep 2014 00:29:54 +0400 Subject: [PATCH] change NumCtxSwitchesStat fields to int64 --- process.go | 4 ++-- process_linux.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/process.go b/process.go index 47abc17..8ad2071 100644 --- a/process.go +++ b/process.go @@ -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 { diff --git a/process_linux.go b/process_linux.go index be8041e..8e60793 100644 --- a/process_linux.go +++ b/process_linux.go @@ -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