Class StatisticMonitoredAttribute

java.lang.Object
com.sun.corba.se.spi.monitoring.MonitoredAttributeBase
com.sun.corba.se.spi.monitoring.StatisticMonitoredAttribute
All Implemented Interfaces:
MonitoredAttribute

public class StatisticMonitoredAttribute extends MonitoredAttributeBase

Author:
Hemanth Puttaswamy

StatisticsMonitoredAttribute is provided as a convenience to collect the Statistics of any entity. The getValue() call will be delegated to the StatisticsAccumulator set by the user.

  • Constructor Details

    • StatisticMonitoredAttribute

      public StatisticMonitoredAttribute(String name, String desc, StatisticsAccumulator s, Object mutex)

      Constructs the StaisticMonitoredAttribute, builds the required MonitoredAttributeInfo with Long as the class type and is always readonly attribute.

      Parameters:
      name - Of this attribute

      desc - should provide a good description on the kind of statistics collected, a good example is "Connection Response Time Stats will Provide the detailed stats based on the samples provided from every request completion time"

      s - is the StatisticsAcumulator that user will use to accumulate the samples and this Attribute Object will get the computed statistics values from.

      mutex - using which clearState() and getValue() calls need to be locked.

  • Method Details

    • getValue

      public Object getValue()
      Gets the value from the StatisticsAccumulator, the value will be a formatted String with the computed statistics based on the samples accumulated in the Statistics Accumulator.
      Specified by:
      getValue in interface MonitoredAttribute
      Specified by:
      getValue in class MonitoredAttributeBase
    • clearState

      public void clearState()
      Clears the state on Statistics Accumulator, After this call all samples are treated fresh and the old sample computations are disregarded.
      Specified by:
      clearState in interface MonitoredAttribute
      Overrides:
      clearState in class MonitoredAttributeBase
    • getStatisticsAccumulator

      public StatisticsAccumulator getStatisticsAccumulator()
      Gets the statistics accumulator associated with StatisticMonitoredAttribute. Usually, the user don't need to use this method as they can keep the handle to Accumulator to collect the samples.