summaryrefslogtreecommitdiff
path: root/pkg/process/state.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-08-12 15:38:19 +0300
committerGitHub <[email protected]>2021-08-12 15:38:19 +0300
commitdf27287c78d7b17d7c8f0e7fff59fa7cbf2a4f9f (patch)
treedf0749155487eae6bcdbb2456885131a21916f4d /pkg/process/state.go
parent67db4b5f7b66e9a32713133baed83c3ab7146bb8 (diff)
parentecbfc5c5265a9895f4e371ce4388f64df8714e63 (diff)
#726: feat(plugin): new `jobs` plugin
#726: feat(plugin): new `jobs` plugin
Diffstat (limited to 'pkg/process/state.go')
-rw-r--r--pkg/process/state.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/process/state.go b/pkg/process/state.go
index 652ec77c..bfc3a287 100644
--- a/pkg/process/state.go
+++ b/pkg/process/state.go
@@ -32,20 +32,20 @@ type State struct {
}
// WorkerProcessState creates new worker state definition.
-func WorkerProcessState(w worker.BaseProcess) (State, error) {
+func WorkerProcessState(w worker.BaseProcess) (*State, error) {
const op = errors.Op("worker_process_state")
p, _ := process.NewProcess(int32(w.Pid()))
i, err := p.MemoryInfo()
if err != nil {
- return State{}, errors.E(op, err)
+ return nil, errors.E(op, err)
}
percent, err := p.CPUPercent()
if err != nil {
- return State{}, err
+ return nil, err
}
- return State{
+ return &State{
CPUPercent: percent,
Pid: int(w.Pid()),
Status: w.State().String(),