mirror of
https://github.com/kemko/nomad.git
synced 2026-01-05 09:55:44 +03:00
Using named variables
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user