com.sun.sgs.impl.service.nodemap.affinity
Class AffinityGroupFinderStats

java.lang.Object
  extended by javax.management.StandardMBean
      extended by com.sun.sgs.impl.service.nodemap.affinity.AffinityGroupFinderStats
All Implemented Interfaces:
AffinityGroupFinderMXBean, DynamicMBean, MBeanRegistration

public class AffinityGroupFinderStats
extends StandardMBean
implements AffinityGroupFinderMXBean

Management info for the label propagation affinity group finder.


Field Summary
static String CONS_NAME
          Our consumer name, created with at ProfileLevel.MEDIUM.
protected  AggregateProfileCounter failed
          The total number of failed algorithm runs.
protected  AggregateProfileSample iterations
          The number of iterations in the last algorithm run.
protected  int numGroups
          The number of groups found in the last algorithm run.
protected  AggregateProfileCounter runs
          The total number of algorithm runs.
protected  AggregateProfileSample runtime
          The time (milliseconds) for the last algorithm run.
protected  AggregateProfileCounter stopped
          The total number of stopped algorithm runs.
 
Fields inherited from interface com.sun.sgs.management.AffinityGroupFinderMXBean
MXBEAN_NAME
 
Constructor Summary
AffinityGroupFinderStats(LPAAffinityGroupFinder finder, ProfileCollector collector, int stopIter)
          Constructs the MXBean for affinity group finder information.
 
Method Summary
 void clear()
          Clears all data values.
 void failedCountInc()
          Increment the count of failed algorithm runs.
 void findAffinityGroups()
          Finds affinity groups based on the current graph information.
 double getAvgIterations()
          Returns the average number of iterations required for algorithm runs.
 double getAvgRunTime()
          Returns the average amount of time, in milliseconds, spent in algorithm runs.
protected  String getDescription(MBeanAttributeInfo info)
          
protected  String getDescription(MBeanInfo info)
          
protected  String getDescription(MBeanOperationInfo op)
          
protected  int getImpact(MBeanOperationInfo op)
          
 long getLastClearTime()
          Returns the time of the last call to AffinityGroupFinderMXBean.clear(), or the time this MBean was created if clear has never been called.
 int getMaxIterations()
          Returns the max number of iterations for any algorithm run.
 long getMaxRunTime()
          Returns the maximum amount of time, in milliseconds, spent in an algorithm run.
 long getMinRunTime()
          Returns the minimum amount of time, in milliseconds, spent in an algorithm run.
 long getNumberFailures()
          Returns the number of times the affinity group finder has failed, due to errors or node failures during a run.
 long getNumberGroups()
          Returns the number of groups found in the latest run of the affinity group finder.
 long getNumberRuns()
          Returns the number of times the affinity group finder has run, including runs that fail.
 long getNumberStopped()
          Returns the number of times the affinity group finder was stopped due to not converging soon enough.
 int getStopIteration()
          Returns the configured maximum number of iterations allowed to run before stopping the algorithm and returning the current results.
 void iterationsSample(long sample)
          Report the number of iterations a run took.
 void runsCountInc()
          Increment the count of algorithm runs.
 void runtimeSample(long sample)
          Report the amount of runtime, in milliseconds, a run took.
 void setNumGroups(int value)
          Set the number of groups found in the last run.
 void stoppedCountInc()
          Increment the count of stopped algorithm runs, due to reaching the maximum number of iterations (if set).
 
Methods inherited from class javax.management.StandardMBean
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getDescription, getDescription, getDescription, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, getParameterName, getParameterName, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONS_NAME

public static final String CONS_NAME
Our consumer name, created with at ProfileLevel.MEDIUM.

See Also:
Constant Field Values

numGroups

protected int numGroups
The number of groups found in the last algorithm run.


iterations

protected final AggregateProfileSample iterations
The number of iterations in the last algorithm run.


runtime

protected final AggregateProfileSample runtime
The time (milliseconds) for the last algorithm run.


runs

protected final AggregateProfileCounter runs
The total number of algorithm runs.


failed

protected final AggregateProfileCounter failed
The total number of failed algorithm runs.


stopped

protected final AggregateProfileCounter stopped
The total number of stopped algorithm runs. Stopped runs are not considered failures.

Constructor Detail

AffinityGroupFinderStats

public AffinityGroupFinderStats(LPAAffinityGroupFinder finder,
                                ProfileCollector collector,
                                int stopIter)
Constructs the MXBean for affinity group finder information.

Parameters:
finder - the affinity group finder
collector - the profile collector
stopIter - the maximum iterations a run will perform
Method Detail

getAvgIterations

public double getAvgIterations()
Returns the average number of iterations required for algorithm runs.

Specified by:
getAvgIterations in interface AffinityGroupFinderMXBean
Returns:
the average number of iterations required for algorithm runs

getAvgRunTime

public double getAvgRunTime()
Returns the average amount of time, in milliseconds, spent in algorithm runs.

Specified by:
getAvgRunTime in interface AffinityGroupFinderMXBean
Returns:
the average amount of time spent in algorithm runs

getMaxIterations

public int getMaxIterations()
Returns the max number of iterations for any algorithm run.

Specified by:
getMaxIterations in interface AffinityGroupFinderMXBean
Returns:
the max number of iterations for any algorithm run

getMaxRunTime

public long getMaxRunTime()
Returns the maximum amount of time, in milliseconds, spent in an algorithm run.

Specified by:
getMaxRunTime in interface AffinityGroupFinderMXBean
Returns:
the maximum amount of time spent in an algorithm run

getMinRunTime

public long getMinRunTime()
Returns the minimum amount of time, in milliseconds, spent in an algorithm run.

Specified by:
getMinRunTime in interface AffinityGroupFinderMXBean
Returns:
the minimum amount of time spent in an algorithm run

getNumberFailures

public long getNumberFailures()
Returns the number of times the affinity group finder has failed, due to errors or node failures during a run.

Specified by:
getNumberFailures in interface AffinityGroupFinderMXBean
Returns:
the number of times the affinity group finder has failed

getNumberGroups

public long getNumberGroups()
Returns the number of groups found in the latest run of the affinity group finder.

Specified by:
getNumberGroups in interface AffinityGroupFinderMXBean
Returns:
the number of groups found in the latest run

getNumberRuns

public long getNumberRuns()
Returns the number of times the affinity group finder has run, including runs that fail.

Specified by:
getNumberRuns in interface AffinityGroupFinderMXBean
Returns:
the number of times the affinity group finder has run

getNumberStopped

public long getNumberStopped()
Returns the number of times the affinity group finder was stopped due to not converging soon enough. A stopped run is not a failed run; valid results are returned.

Specified by:
getNumberStopped in interface AffinityGroupFinderMXBean
Returns:
the number of times the affinity group finder was stopped

getStopIteration

public int getStopIteration()
Returns the configured maximum number of iterations allowed to run before stopping the algorithm and returning the current results.

Specified by:
getStopIteration in interface AffinityGroupFinderMXBean
Returns:
the configured maximum number of iterations

clear

public void clear()
Clears all data values.

Specified by:
clear in interface AffinityGroupFinderMXBean

getLastClearTime

public long getLastClearTime()
Returns the time of the last call to AffinityGroupFinderMXBean.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 AffinityGroupFinderMXBean
Returns:
the time of the last call to clear

findAffinityGroups

public void findAffinityGroups()
Finds affinity groups based on the current graph information. This will start a new run of the affinity group finder, or wait for the current run to complete.

NOTE: This method is useful for testing but may be removed.

Specified by:
findAffinityGroups in interface AffinityGroupFinderMXBean

getDescription

protected String getDescription(MBeanInfo info)

Overrides:
getDescription in class StandardMBean

getDescription

protected String getDescription(MBeanAttributeInfo info)

Overrides:
getDescription in class StandardMBean

getDescription

protected String getDescription(MBeanOperationInfo op)

Overrides:
getDescription in class StandardMBean

getImpact

protected int getImpact(MBeanOperationInfo op)

Overrides:
getImpact in class StandardMBean

iterationsSample

public void iterationsSample(long sample)
Report the number of iterations a run took.

Parameters:
sample - the number of iterations

runtimeSample

public void runtimeSample(long sample)
Report the amount of runtime, in milliseconds, a run took.

Parameters:
sample - the amount of runtime, in msecs

runsCountInc

public void runsCountInc()
Increment the count of algorithm runs.


failedCountInc

public void failedCountInc()
Increment the count of failed algorithm runs.


stoppedCountInc

public void stoppedCountInc()
Increment the count of stopped algorithm runs, due to reaching the maximum number of iterations (if set).


setNumGroups

public void setNumGroups(int value)
Set the number of groups found in the last run.

Parameters:
value - the number of groups found in the last run.

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