com.tc.statistics
Interface StatisticRetrievalAction


public interface StatisticRetrievalAction

This interface has to be implemented to retrieve statistics data from system. StatisticRetrievalAction is abbreviated as SRA throughout the statistics infrastructure. The accent is really situated on the 'retrieval' part. Usually, a StatisticRetrievalAction implementation will interact with another part of the system that is responsible for measuring and sampling the data itself. SRA classes are instantiated only once within the agent that they belong to. The instances are shared amongst statistics capture sessions. Therefore, SRA classes should not have any non-final instance state.


Field Summary
static StatisticData[] EMPTY_STATISTIC_DATA
          Convenience field that allows SRAs to return empty data.
 
Method Summary
 java.lang.String getName()
          The name that uniquely identifies this SRA.
 StatisticType getType()
          Returns the type of this SRA class.
 StatisticData[] retrieveStatisticData()
          Retrieves statistics data from the system and formats it as an array of StatisticData instances.
 

Field Detail

EMPTY_STATISTIC_DATA

static final StatisticData[] EMPTY_STATISTIC_DATA
Convenience field that allows SRAs to return empty data.

Method Detail

retrieveStatisticData

StatisticData[] retrieveStatisticData()
Retrieves statistics data from the system and formats it as an array of StatisticData instances. Instead of returning null when data is not available, it's recommended to return EMPTY_STATISTIC_DATA. All expected exceptions that occur during data retrieval should be handled within this method and shouldn't bubble up. For instance of infinite or NaN values are present as data values. In those situations one can either create empty data values or a return an empty array. This depends on what is appropriate for this particular SRA implementation.

Returns:
the retrieved statistic data

getName

java.lang.String getName()
The name that uniquely identifies this SRA. This name is used when SRAs are listed by a statistics agent and when they are activated/deactivated. This is independent of the name that is used within the StatisticData instances that are returned from retrieveStatisticData(). It is however recommended for the SRA name to be the prefix of the name within StatisticData. Note that it's recommended to have this name available as a public static final class field to allow other parts of the code to refer to this name without having to hard-code strings.

Returns:
the name of this SRA

getType

StatisticType getType()
Returns the type of this SRA class.

Returns:
the type instance


Copyright © 2010 Terracotta, Inc.. All Rights Reserved.