From 3eaadcd5e056e5701590a19516e36fc9312145bf Mon Sep 17 00:00:00 2001 From: Thomas Barrett Date: Thu, 15 Feb 2024 02:46:45 -0800 Subject: [PATCH] Add support for gtime and cgtime stats. (#597) Signed-off-by: Thomas Barrett Co-authored-by: Thomas Barrett --- proc_stat.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/proc_stat.go b/proc_stat.go index 923e5500..06a8d931 100644 --- a/proc_stat.go +++ b/proc_stat.go @@ -110,6 +110,11 @@ type ProcStat struct { Policy uint // Aggregated block I/O delays, measured in clock ticks (centiseconds). DelayAcctBlkIOTicks uint64 + // Guest time of the process (time spent running a virtual CPU for a guest + // operating system), measured in clock ticks. + GuestTime int + // Guest time of the process's children, measured in clock ticks. + CGuestTime int proc FS } @@ -189,6 +194,8 @@ func (p Proc) Stat() (ProcStat, error) { &s.RTPriority, &s.Policy, &s.DelayAcctBlkIOTicks, + &s.GuestTime, + &s.CGuestTime, ) if err != nil { return ProcStat{}, err