Package org.bootchart.parser.linux
Class PsParser
java.lang.Object
org.bootchart.parser.linux.PsParser
PsParser parses log files produced by
ps.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
PsParser
public PsParser()
-
-
Method Details
-
parseLog
Parses theps.logfile. Consecutive ps samples are parsed and returned in a list. The ps samples are only parsed up to the point where one of the specifiedexitProcessesis running and the system is idle.If
pidNameMapis set, it is used to map PIDs to command names. This is useful when init scripts are sourced, and thus ps is unable to report the proper process name. A sysinit modification is necessary to generate the mapping log file.forkMapis an optional map that provides detailed information about process forking.- Parameters:
is- the input stream to read frompidNameMap- PID to name mapping map (optional)forkMap- process forking map (optional)- Returns:
- ps statistics and a list of processes
- Throws:
IOException- if an I/O error occurs
-
getState
Returns the process state. State can be one of:- "D": uninterruptible sleep
- "R": running
- "S": sleeping
- "T": traced or stopped
- "Z": zombie
- Parameters:
procInfo- process info map- Returns:
- process state
-