summaryrefslogtreecommitdiff
path: root/state/process/state.go
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/process/state.go
parent859a9f696f732fa58dd49427a936fd0fecc0bc7d (diff)
improve codecov
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'state/process/state.go')
-rw-r--r--state/process/state.go20
1 files changed, 0 insertions, 20 deletions
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
-}