com.sun.slamd.server
Class RealTimeJobStatList

java.lang.Object
  extended bycom.sun.slamd.server.RealTimeJobStatList

public class RealTimeJobStatList
extends java.lang.Object

This class defines a data type that will be used to hold real-time stat data for a particular statistic in a particular job. Note that this class is not designed to be threadsafe, so any operations on it should be properly synchronized by the callers.


Constructor Summary
RealTimeJobStatList(java.lang.String statName, int maxIntervals)
          Creates a new real-time job stat list.
 
Method Summary
 void addValue(int intervalNumber, double value, boolean averageData)
          Adds the provided value to the data for the given interval in the list.
 int getFirstInterval()
          Retrieves the interval number of the first interval currently held in this stat list.
 int getLastInterval()
          Retrieves the interval number of the last interval currently held in this stat list.
 double[] getStatData()
          Retrieves a copy of the data currently held in this stat list.
 java.lang.String getStatName()
          Retrieves the name of the statistic with which this data is associated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RealTimeJobStatList

public RealTimeJobStatList(java.lang.String statName,
                           int maxIntervals)
Creates a new real-time job stat list.

Parameters:
statName - The name of the statistic with which this data is associated.
maxIntervals - The maximum number of collection intervals that will be maintained for this statistic.
Method Detail

getStatName

public java.lang.String getStatName()
Retrieves the name of the statistic with which this data is associated.

Returns:
The name of the statistic with which this data is associated.

getFirstInterval

public int getFirstInterval()
Retrieves the interval number of the first interval currently held in this stat list.

Returns:
The interval number of the first interval currently held in this stat list.

getLastInterval

public int getLastInterval()
Retrieves the interval number of the last interval currently held in this stat list.

Returns:
The interval number of the last interval currently held in this stat list.

getStatData

public double[] getStatData()
Retrieves a copy of the data currently held in this stat list.

Returns:
A copy of the data currently held in this stat list.

addValue

public void addValue(int intervalNumber,
                     double value,
                     boolean averageData)
Adds the provided value to the data for the given interval in the list.

Parameters:
intervalNumber - The interval number in which the update is to be made.
value - The value to add to the data for that interval.
averageData - Indicates whether the data associated with this statistic should be averaged.