diff options
author | Valery Piashchynski <[email protected]> | 2021-07-11 10:11:22 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-07-11 10:11:22 +0300 |
commit | 589f759cc2411319adbca2ece0dbe212407d1eba (patch) | |
tree | 2fbea4a6033d65813c41fd80f6339a524b46c9b2 /pkg | |
parent | cb2665d93ad7abe1ab30508ff0e2bd4d0bc379ea (diff) |
Update informer interface to return slice of pointers (do not over-copy
the Stat structure).
Make amqp Push concurrent safe.
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/priority_queue/binary_heap.go (renamed from pkg/priorityqueue/binary_heap.go) | 0 | ||||
-rw-r--r-- | pkg/priority_queue/binary_heap_test.go (renamed from pkg/priorityqueue/binary_heap_test.go) | 0 | ||||
-rw-r--r-- | pkg/priority_queue/interface.go (renamed from pkg/priorityqueue/interface.go) | 0 | ||||
-rw-r--r-- | pkg/process/state.go | 8 |
4 files changed, 4 insertions, 4 deletions
diff --git a/pkg/priorityqueue/binary_heap.go b/pkg/priority_queue/binary_heap.go index e47dd2c8..e47dd2c8 100644 --- a/pkg/priorityqueue/binary_heap.go +++ b/pkg/priority_queue/binary_heap.go diff --git a/pkg/priorityqueue/binary_heap_test.go b/pkg/priority_queue/binary_heap_test.go index 06d0735c..06d0735c 100644 --- a/pkg/priorityqueue/binary_heap_test.go +++ b/pkg/priority_queue/binary_heap_test.go diff --git a/pkg/priorityqueue/interface.go b/pkg/priority_queue/interface.go index 8278dc8d..8278dc8d 100644 --- a/pkg/priorityqueue/interface.go +++ b/pkg/priority_queue/interface.go 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(), |