org.bootchart.parser.linux

## Class PacctParser

- java.lang.Object
- - org.bootchart.parser.linux.PacctParser

-     public class PacctParser
      extends java.lang.Object

  PacctParser parses the BSD process accounting v3 files. The accounting file contains information about process creation times, PIDs, PPIDs etc. It is used to get detailed information about process forks, filling in any dependency blanks caused by the polling nature of `/proc/[PID]/top` logging.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PacctParser()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.List` | `getPPIDs(int pid, java.util.Map forkMap)` Returns a list of all parent PIDs (parent, grandparent, etc.) for the specified PID.
    `static java.util.Map` | `parseLog(java.io.InputStream is)` Parses the `pacct` accounting file.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PacctParser

          public PacctParser()

  - ### Method Detail

    - #### parseLog

          public static java.util.Map parseLog(java.io.InputStream is)
                                        throws java.io.IOException

      Parses the `pacct` accounting file. See `include/linux/acct.h` for format.
      Parameters:
        `is` - the input stream to parse
      Returns:
        a map of Integer to Integer forks
      Throws:
        `java.io.IOException` - if an I/O error occurs

    - #### getPPIDs

          public static java.util.List getPPIDs(int pid,
                                                java.util.Map forkMap)

      Returns a list of all parent PIDs (parent, grandparent, etc.) for the specified PID.
      Parameters:
        `pid` - the PID to get the PPIDs for
        `forkMap` - fork map
      Returns:
        a list of parent PIDs