summaryrefslogtreecommitdiff
path: root/state
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-12-01 18:35:28 +0300
committerValery Piashchynski <[email protected]>2021-12-01 18:35:28 +0300
commit005bce86625b8fffdb3657103ee5589cbb6eed87 (patch)
tree15adef89d99954a71f5c45f8748ed7e66e57d7c4 /state
parent859a9f696f732fa58dd49427a936fd0fecc0bc7d (diff)
improve codecov
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'state')
-rw-r--r--state/job/state.go19
-rw-r--r--state/process/state.go20
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
-}