diff --git a/client/driver/executor/executor.go b/client/driver/executor/executor.go index 37df9cb32..0a047fe44 100644 --- a/client/driver/executor/executor.go +++ b/client/driver/executor/executor.go @@ -741,7 +741,12 @@ func (e *UniversalExecutor) scanPids(parentPid int, allPids []ps.Process) ([]*no } res := make([]*nomadPid, 0, len(processFamily)) for pid := range processFamily { - res = append(res, &nomadPid{pid, stats.NewCpuStats(), stats.NewCpuStats(), stats.NewCpuStats()}) + res = append(res, &nomadPid{ + pid: pid, + cpuStatsTotal: stats.NewCpuStats(), + cpuStatsUser: stats.NewCpuStats(), + cpuStatsSys: stats.NewCpuStats(), + }) } return res, nil } diff --git a/client/driver/executor/executor_linux.go b/client/driver/executor/executor_linux.go index 0aac80929..41be4da0f 100644 --- a/client/driver/executor/executor_linux.go +++ b/client/driver/executor/executor_linux.go @@ -271,7 +271,12 @@ func (e *UniversalExecutor) getAllPids() ([]*nomadPid, error) { } np := make([]*nomadPid, len(pids)) for idx, pid := range pids { - np[idx] = &nomadPid{pid, stats.NewCpuStats(), stats.NewCpuStats(), stats.NewCpuStats()} + np[idx] = &nomadPid{ + pid: pid, + cpuStatsTotal: stats.NewCpuStats(), + cpuStatsSys: stats.NewCpuStats(), + cpuStatsUser: stats.NewCpuStats(), + } } return np, nil }