|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.bootchart.parser.linux.TopParser
TopParser parses log files produced by top
. The log files
are produced when running top
in batch mode.
Nested Class Summary | |
static class |
TopParser.TopStats
Top statistics. |
Field Summary | |
static java.util.List |
EXIT_PROCESS_LIST
Default boot completion process list. |
Constructor Summary | |
TopParser()
|
Method Summary | |
static int |
correctTimes(Stats stats)
Corrects sampling times. |
static int |
getState(java.util.Map procInfo)
Returns the process state. |
static TopParser.TopStats |
parseLog(java.io.BufferedReader reader,
java.util.Map pidNameMap,
java.util.Map forkMap)
Parses the top log file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.util.List EXIT_PROCESS_LIST
Constructor Detail |
public TopParser()
Method Detail |
public static TopParser.TopStats parseLog(java.io.BufferedReader reader, java.util.Map pidNameMap, java.util.Map forkMap) throws java.io.IOException, java.text.ParseException
top
log file. Consecutive top samples are
parsed and returned in a list. The top samples are only parsed up to
the point where the specified exitProcess
is running and
the system is idle.
Sensible exitProcess
values are "mingetty" (for
runlevel 3 boots), "gdmgreeter" (for analyzing till the GDM login)
and "gnome-panel" (for analyzing the gnome login as well).
If pidNameMap
is set, it is used to map PIDs to
command names. This useful when init scripts are sourced, and thus
top is unable to report the proper process name. A sysinit
modification is necessary to generate the mapping log file.
forkMap
is an optional map that provides detailed
information on process forking.
reader
- the reader to read frompidNameMap
- PID to name mapping map (optional)forkMap
- process forking map (optional)
java.io.IOException
- if an I/O error occurs
java.text.ParseException
- if the log file is not properly formattedpublic static int getState(java.util.Map procInfo)
procInfo
- top info map
public static int correctTimes(Stats stats)
The sample time resolution is also increased if necessary.
stats
- the statistics to correct times for
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |