getProcessStatus: Return process status information

Description Usage Arguments Value Examples

View source: R/getProcessStatus.R

Description

Returns a dataframe of information from the ps command.

Usage

1
getProcessStatus(psPath = "/bin/ps")

Arguments

psPath

Full path of the ps command.

Value

A dataframe of information from the ps command.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
library(dplyr)

# CPU hogs
cpu_hogs <- getProcessStatus() %>%
  select(pcpu,user) %>%
  group_by(user) %>%
  summarise(cpu_usage = sum(pcpu)) %>%
  arrange(desc(cpu_usage))

head(cpu_hogs)

# Long processes
long_running <- getProcessStatus() %>%
  select(user, esecs, pid, command) %>%
  filter(user != "root") %>%
  arrange(desc(esecs))

head(long_running)

## End(Not run)

MazamaScience/MazamaProductionUtils documentation built on May 17, 2019, 10:16 a.m.