diff options
author | Valery Piashchynski <[email protected]> | 2021-12-01 18:35:28 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-12-01 18:35:28 +0300 |
commit | 005bce86625b8fffdb3657103ee5589cbb6eed87 (patch) | |
tree | 15adef89d99954a71f5c45f8748ed7e66e57d7c4 /state | |
parent | 859a9f696f732fa58dd49427a936fd0fecc0bc7d (diff) |
improve codecov
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'state')
-rw-r--r-- | state/job/state.go | 19 | ||||
-rw-r--r-- | state/process/state.go | 20 |
2 files changed, 0 insertions, 39 deletions
diff --git a/state/job/state.go b/state/job/state.go deleted file mode 100644 index 56050084..00000000 --- a/state/job/state.go +++ /dev/null @@ -1,19 +0,0 @@ -package job - -// State represents job's state -type State struct { - // Pipeline name - Pipeline string - // Driver name - Driver string - // Queue name (tube for the beanstalk) - Queue string - // Active jobs which are consumed from the driver but not handled by the PHP worker yet - Active int64 - // Delayed jobs - Delayed int64 - // Reserved jobs which are in the driver but not consumed yet - Reserved int64 - // Status - 1 Ready, 0 - Paused - Ready bool -} diff --git a/state/process/state.go b/state/process/state.go index f88f8b03..d49d526f 100644 --- a/state/process/state.go +++ b/state/process/state.go @@ -54,23 +54,3 @@ func WorkerProcessState(w worker.BaseProcess) (*State, error) { MemoryUsage: i.RSS, }, nil } - -func GeneralProcessState(pid int, command string) (State, error) { - const op = errors.Op("process_state") - p, _ := process.NewProcess(int32(pid)) - i, err := p.MemoryInfo() - if err != nil { - return State{}, errors.E(op, err) - } - percent, err := p.CPUPercent() - if err != nil { - return State{}, err - } - - return State{ - CPUPercent: percent, - Pid: pid, - MemoryUsage: i.RSS, - Command: command, - }, nil -} |