com.sun.sgs.impl.profile
Class TaskAggregateStats

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by com.sun.sgs.impl.profile.TaskAggregateStats
All Implemented Interfaces:
TaskAggregateMXBean, NotificationBroadcaster, NotificationEmitter

public class TaskAggregateStats
extends NotificationBroadcasterSupport
implements TaskAggregateMXBean

The central location to aggregate information on tasks run through the system. Only bounded transactions are aggregated. Successful transactions that take longer than the standard transaction timeout are typically used for application startup tasks, and are not included.


Field Summary
 
Fields inherited from interface com.sun.sgs.management.TaskAggregateMXBean
MXBEAN_NAME
 
Constructor Summary
TaskAggregateStats(ProfileCollector collector, String name)
          Creates an MXBean object for gathering task data in the system.
 
Method Summary
 void clear()
          Clears all data values.
 long getLastClearTime()
          Returns the time of the last call to TaskAggregateMXBean.clear(), or the time this MBean was created if clear has never been called.
 double getReadyCountAvg()
          Returns the average number of tasks which are ready to run in the system.
 double getSmoothingFactor()
          Returns the smoothing factor used for averages in this MBean.
 double getSuccessfulLagTimeAvg()
          Returns the average lag time for successful tasks, in milliseconds.
 double getSuccessfulLatencyAvg()
          Returns the average latency for successful tasks, in milliseconds.
 double getSuccessfulRuntimeAvg()
          Returns the average runtime for successful tasks, in milliseconds.
 long getSuccessfulRuntimeMax()
          Returns the maximum runtime for successful tasks, in milliseconds.
 long getTaskCount()
          Returns the total number of tasks run.
 long getTaskFailureCount()
          Returns the total number of tasks which failed.
 double getTaskFailurePercentage()
          Returns the percentage of failed tasks to total tasks.
 long getTransactionalTaskCount()
          Returns the total number of transactional tasks run.
(package private)  void notifyTaskQueue()
          Send a notification that the task queue is falling behind.
 void setSmoothingFactor(double newFactor)
          Set the smoothing factor for all averages in this MBean, between 0.0 and 1.0, inclusive.
(package private)  void taskFinishedCommon(boolean trans, long ready)
           
(package private)  void taskFinishedFail(boolean trans, long ready)
           
(package private)  void taskFinishedSuccess(boolean trans, long ready, long run, long lag)
           
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskAggregateStats

TaskAggregateStats(ProfileCollector collector,
                   String name)
Creates an MXBean object for gathering task data in the system.

Parameters:
collector - the system profile collector
name - the name of the profile consumer created to support this object
Method Detail

notifyTaskQueue

void notifyTaskQueue()
Send a notification that the task queue is falling behind. This method is not used yet.


getTaskCount

public long getTaskCount()
Returns the total number of tasks run.

Specified by:
getTaskCount in interface TaskAggregateMXBean
Returns:
the total number of tasks run

getTransactionalTaskCount

public long getTransactionalTaskCount()
Returns the total number of transactional tasks run.

Specified by:
getTransactionalTaskCount in interface TaskAggregateMXBean
Returns:
the total number of transactional tasks run

getTaskFailureCount

public long getTaskFailureCount()
Returns the total number of tasks which failed.

Specified by:
getTaskFailureCount in interface TaskAggregateMXBean
Returns:
the total number of tasks which failed

getSmoothingFactor

public double getSmoothingFactor()
Returns the smoothing factor used for averages in this MBean.

Specified by:
getSmoothingFactor in interface TaskAggregateMXBean
Returns:
the smoothing factory used for averages

setSmoothingFactor

public void setSmoothingFactor(double newFactor)
Set the smoothing factor for all averages in this MBean, between 0.0 and 1.0, inclusive. A value closer to 1.0 provides less smoothing of the data, and more weight to recent data; a value closer to 0.0 provides more smoothing but is less responsive to recent changes.

Specified by:
setSmoothingFactor in interface TaskAggregateMXBean
Parameters:
newFactor - the new smoothing factor

getSuccessfulRuntimeMax

public long getSuccessfulRuntimeMax()
Returns the maximum runtime for successful tasks, in milliseconds.

Specified by:
getSuccessfulRuntimeMax in interface TaskAggregateMXBean
Returns:
the maximum runtime for successful tasks

getSuccessfulRuntimeAvg

public double getSuccessfulRuntimeAvg()
Returns the average runtime for successful tasks, in milliseconds.

Specified by:
getSuccessfulRuntimeAvg in interface TaskAggregateMXBean
Returns:
the average runtime for successful tasks

getTaskFailurePercentage

public double getTaskFailurePercentage()
Returns the percentage of failed tasks to total tasks.

Specified by:
getTaskFailurePercentage in interface TaskAggregateMXBean
Returns:
the percentage of failed tasks to total tasks

getReadyCountAvg

public double getReadyCountAvg()
Returns the average number of tasks which are ready to run in the system. A large average indicates the task queue is falling behind.

Specified by:
getReadyCountAvg in interface TaskAggregateMXBean
Returns:
the average number of tasks which are ready to run

getSuccessfulLagTimeAvg

public double getSuccessfulLagTimeAvg()
Returns the average lag time for successful tasks, in milliseconds. Lag time is the amount of time spent on the ready queue before the task starts.

Specified by:
getSuccessfulLagTimeAvg in interface TaskAggregateMXBean
Returns:
the average lag time for successful tasks

getSuccessfulLatencyAvg

public double getSuccessfulLatencyAvg()
Returns the average latency for successful tasks, in milliseconds. Latency is total amount of time it takes a successful task to run, and is the sum of lagtime and runtime.

Specified by:
getSuccessfulLatencyAvg in interface TaskAggregateMXBean
Returns:
the average latency for successful tasks.

clear

public void clear()
Clears all data values.

Specified by:
clear in interface TaskAggregateMXBean

getLastClearTime

public long getLastClearTime()
Returns the time of the last call to TaskAggregateMXBean.clear(), or the time this MBean was created if clear has never been called. The time is the difference, measured in milliseconds, between the time at which this was last cleared and midnight, January 1, 1970 UTC.

Specified by:
getLastClearTime in interface TaskAggregateMXBean
Returns:
the time of the last call to clear

taskFinishedSuccess

void taskFinishedSuccess(boolean trans,
                         long ready,
                         long run,
                         long lag)

taskFinishedFail

void taskFinishedFail(boolean trans,
                      long ready)

taskFinishedCommon

void taskFinishedCommon(boolean trans,
                        long ready)

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved