com.sun.slamd.stat
Class RealTimeStatReporter

java.lang.Object
  extended byjava.lang.Thread
      extended bycom.sun.slamd.stat.RealTimeStatReporter
All Implemented Interfaces:
java.lang.Runnable

public class RealTimeStatReporter
extends java.lang.Thread

This class defines a component that can be used to report statistical data to the SLAMD server in real-time.


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
RealTimeStatReporter(java.lang.String serverAddress, int serverStatPort, int reportInterval, java.lang.String clientID, java.lang.String authID, java.lang.String authPW, boolean useSSL, boolean blindTrust, java.lang.String sslKeyStore, java.lang.String sslKeyPassword, java.lang.String sslTrustStore, java.lang.String sslTrustPassword)
          Creates a new instance of this real-time stat reporter.
 
Method Summary
 void doneReporting(StatTracker statTracker, int intervalNumber)
          Indicates that the stat tracker will not be providing any more data.
 void registerStat(java.lang.String jobID, StatTracker statTracker)
          Sends a message to the SLAMD server indicating that a new statistic will be reported.
 void reportStatToAdd(StatTracker statTracker, int intervalNumber, double statValue)
          Indicates that the provided value should be added to the corresponding values for all threads by all clients for this statistic and interval.
 void reportStatToAverage(StatTracker statTracker, int intervalNumber, double statValue)
          Indicates that the provided value should be averaged with the corresponding values for all threads by all clients for this statistic and interval.
 void run()
          Loops repeatedly waiting for new messages to send to the SLAMD server.
 void stopRunning()
          Indicates that this stat reporter should stop running.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RealTimeStatReporter

public RealTimeStatReporter(java.lang.String serverAddress,
                            int serverStatPort,
                            int reportInterval,
                            java.lang.String clientID,
                            java.lang.String authID,
                            java.lang.String authPW,
                            boolean useSSL,
                            boolean blindTrust,
                            java.lang.String sslKeyStore,
                            java.lang.String sslKeyPassword,
                            java.lang.String sslTrustStore,
                            java.lang.String sslTrustPassword)
                     throws SLAMDException
Creates a new instance of this real-time stat reporter.

Parameters:
serverAddress - The address to use to connect to the SlAMD server when reporting statistics.
serverStatPort - The port number to use to connect to the SLAMD server when reporting statistics.
reportInterval - The interval at which statistics should be reported to the server.
clientID - The ID assigned to the client that will be providing the statistics to report.
authID - The ID to use to authenticate to the SLAMD server.
authPW - The password to use to authenticate to the SLAMD server.
useSSL - Indicates whether to use SSL to communicate with the server.
blindTrust - Indicates whether to blindly trust any SSL certificate presented by the server.
sslKeyStore - The JSSE key store to use.
sslKeyPassword - The password to use to access the information in the JSSE key store.
sslTrustStore - The JSSE trust store to use.
sslTrustPassword - The password to use to access the information in the JSSE trust store.
Throws:
SLAMDException - If a problem occurs establishing the connection to the SLAMD server.
Method Detail

registerStat

public void registerStat(java.lang.String jobID,
                         StatTracker statTracker)
Sends a message to the SLAMD server indicating that a new statistic will be reported. This should be called for each individual stat tracker being used (even for those running in separate threads on the same client).

Parameters:
jobID - The ID of the job for which the statistical data will be provided.
statTracker - The stat tracker being registered.

reportStatToAdd

public void reportStatToAdd(StatTracker statTracker,
                            int intervalNumber,
                            double statValue)
Indicates that the provided value should be added to the corresponding values for all threads by all clients for this statistic and interval.

Parameters:
statTracker - The stat tracker reporting the statistic.
intervalNumber - The interval number for this value.
statValue - the value being reported.

reportStatToAverage

public void reportStatToAverage(StatTracker statTracker,
                                int intervalNumber,
                                double statValue)
Indicates that the provided value should be averaged with the corresponding values for all threads by all clients for this statistic and interval.

Parameters:
statTracker - The stat tracker reporting the statistic.
intervalNumber - The interval number for this value.
statValue - the value being reported.

doneReporting

public void doneReporting(StatTracker statTracker,
                          int intervalNumber)
Indicates that the stat tracker will not be providing any more data.

Parameters:
statTracker - The stat tracker that is done reporting.
intervalNumber - The interval number for this message.

run

public void run()
Loops repeatedly waiting for new messages to send to the SLAMD server.


stopRunning

public void stopRunning()
Indicates that this stat reporter should stop running.