|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 |
---|
static final StatisticData[] EMPTY_STATISTIC_DATA
Method Detail |
---|
StatisticData[] retrieveStatisticData()
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.
java.lang.String getName()
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.
StatisticType getType()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |