org.bootchart.parser

## Class HeaderParser

- java.lang.Object
- - org.bootchart.parser.HeaderParser

-     public class HeaderParser
      extends java.lang.Object

  HeaderParser parses the `header` log file, which contains the chart title and basic information about the system, OS release, CPU, etc.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HeaderParser()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `getNumCPUs(java.util.Properties headers)` Get the number of CPUs from the `system.cpu` header property.
    `static java.util.Properties` | `oldParseLog(java.io.BufferedReader reader)` Parses the header log file (old version).
    `static java.util.Properties` | `parseLog(java.io.InputStream is)` Parses the header log file.

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

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

- - ### Constructor Detail

    - #### HeaderParser

          public HeaderParser()

  - ### Method Detail

    - #### parseLog

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

      Parses the header log file. The `Properties` instance should contain at least the following values:
      - title
      (e.g. "Boot chart for serenity.klika.si (Sun Nov 21 01:48:05 CET 2004)")
      - system.uname
      (e.g. "Linux 2.6.7 #2 Thu Jul 1 14:25:23 CEST 2004 i686 GNU/Linux")
      - system.release
      (e.g. "Fedora Core release 3 (Heidelberg)")
      - system.cpu
      (e.g. "Intel(R) Pentium(R) M processor 1500MHz")
      - system.kernel.options
      (e.g. "cmdline: ro root=/dev/vg0/root vga=0x318 rhgb")
      Parameters:
        `is` - the input stream to read from
      Returns:
        header properties
      Throws:
        `java.io.IOException` - if an I/O error occurs

    - #### oldParseLog

          public static java.util.Properties oldParseLog(java.io.BufferedReader reader)
                                                  throws java.io.IOException

      Parses the header log file (old version).
      Parameters:
        `reader` - the reader to read from
      Returns:
        header properties
      Throws:
        `java.io.IOException` - if an I/O error occurs

    - #### getNumCPUs

          public static int getNumCPUs(java.util.Properties headers)

      Get the number of CPUs from the `system.cpu` header property.
      Parameters:
        `headers` - header properties
      Returns:
        the number of CPUs