org.bootchart.common
Class Process

java.lang.Object
  extended by org.bootchart.common.Process
All Implemented Interfaces:
Comparable

public class Process
extends Object
implements Comparable

Process encapsulation.


Field Summary
 boolean active
          Whether the process is active.
 List childList
          A list of children Processes.
 String cmd
          Command line.
 String desc
          Process decription (e.g.
 long duration
          Process duration in milliseconds.
 Process parent
          Parent process.
 int pid
          Process ID.
 int ppid
          Parent process ID.
 List samples
          A list of process statistics samples.
 Date startTime
          Process start time.
static int STATE_RUNNING
          Running state.
static int STATE_SLEEPING
          Sleeping state.
static int STATE_STOPPED
          Stopped or traced.
static int STATE_UNDEFINED
          Undefined state.
static int STATE_WAITING
          Uninterruptible sleep.
static int STATE_ZOMBIE
          Zombie state (defunct).
 
Constructor Summary
Process(int pid, String cmd)
          Created a new process.
 
Method Summary
 int compareTo(Object o)
           
 boolean equals(Object o)
           
 int hashCode()
           
 String toString()
          Returns a string representation of the process.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

STATE_UNDEFINED

public static final int STATE_UNDEFINED
Undefined state.

See Also:
Constant Field Values

STATE_RUNNING

public static final int STATE_RUNNING
Running state.

See Also:
Constant Field Values

STATE_SLEEPING

public static final int STATE_SLEEPING
Sleeping state.

See Also:
Constant Field Values

STATE_WAITING

public static final int STATE_WAITING
Uninterruptible sleep.

See Also:
Constant Field Values

STATE_STOPPED

public static final int STATE_STOPPED
Stopped or traced.

See Also:
Constant Field Values

STATE_ZOMBIE

public static final int STATE_ZOMBIE
Zombie state (defunct).

See Also:
Constant Field Values

pid

public int pid
Process ID.


cmd

public String cmd
Command line.


desc

public String desc
Process decription (e.g. PID and command, script stack trace, etc.).


startTime

public Date startTime
Process start time.


duration

public long duration
Process duration in milliseconds.


parent

public Process parent
Parent process.


ppid

public int ppid
Parent process ID.


childList

public List childList
A list of children Processes.


samples

public List samples
A list of process statistics samples.


active

public boolean active
Whether the process is active. A process is active if it contains at least one non-sleeping sample. Idle processes are optionally filtered out.

Constructor Detail

Process

public Process(int pid,
               String cmd)
Created a new process.

Parameters:
pid - process ID
cmd - command line
Method Detail

toString

public String toString()
Returns a string representation of the process.

Overrides:
toString in class Object
Returns:
string representation

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object