org.bootchart.common
クラス Common

java.lang.Object
  上位を拡張 org.bootchart.common.Common

public class Common
extends Object

Common methods.


入れ子のクラスの概要
static class Common.LogFileFilter
          File name filter for bootchart log files.
 
フィールドの概要
static Locale LOCALE
          Default locale.
static int MAX_PARSE_SAMPLES
          The maximum number of samples to parse.
static List PROC_PARAM
          A list of processes which should include parameters in their command lines.
static String VERSION
          Program version.
 
コンストラクタの概要
Common()
           
 
メソッドの概要
static String formatCommand(String cmd)
          Format the specified command line.
static String getProcessDesc(Process proc, Date startTime)
          Returns the text to include in the process description pop-up.
static BufferedReader getReader(InputStream is)
          Returns a buffered reader suitable for reading the input stream.
static boolean isPNGSupported()
          Whether the running JVM supports PNG encoding.
static String loadFile(File file)
          Loads the contents of the file.
static double parseDouble(String s)
          Returns a new double initialized to the value represented by the specified String.
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

VERSION

public static final String VERSION
Program version.

関連項目:
定数フィールド値

LOCALE

public static final Locale LOCALE
Default locale.


PROC_PARAM

public static final List PROC_PARAM
A list of processes which should include parameters in their command lines.


MAX_PARSE_SAMPLES

public static final int MAX_PARSE_SAMPLES
The maximum number of samples to parse.

関連項目:
定数フィールド値
コンストラクタの詳細

Common

public Common()
メソッドの詳細

loadFile

public static String loadFile(File file)
                       throws IOException
Loads the contents of the file. The file is either read from the file system or retrieved as resource stream.

パラメータ:
file - the file to read
戻り値:
file contents string
例外:
IOException - if an I/O error occurs

getReader

public static BufferedReader getReader(InputStream is)
                                throws IOException
Returns a buffered reader suitable for reading the input stream.

パラメータ:
is - input stream to read
戻り値:
buffered reader
例外:
IOException - if an I/O error occurs

parseDouble

public static double parseDouble(String s)
Returns a new double initialized to the value represented by the specified String. Any decimal commas in the string are replaced with dots.

パラメータ:
s - the string to be parsed
戻り値:
the double value represented by the string argument

formatCommand

public static String formatCommand(String cmd)
Format the specified command line. Shell invocations, paths and parameters are removed (e.g. "/bin/bash /etc/rc.d/rc.sysinit" -> "rc.sysinit"). Paramaters are included for certain commands (e.g. modprobe and rc).

パラメータ:
cmd - command line
戻り値:
a trimed command line

getProcessDesc

public static String getProcessDesc(Process proc,
                                    Date startTime)
Returns the text to include in the process description pop-up. The description includes the PID, command name, start time, duration and any user-specified description (e.g. script stack trace).

パラメータ:
proc - the process to get description for
startTime - process tree start time
戻り値:
a multiline process description text

isPNGSupported

public static boolean isPNGSupported()
Whether the running JVM supports PNG encoding. Some runtime environments (e.g. those based on GNU Classpath) don't have the necessary Graphics2D support.

戻り値:
whether this JVM supports PNG encoding