public interface SAMHelper extends ServiceHelper
SAMHelper
by means of
the getHelper()
method of the Agent
class and register providers
of measures for the entities that have to be monitored. The underlying SAM Service periodically
invokes such providers and collects all retrieved information in the Main Container aggregating them
properly. Many providers can be registered (possibly in different containers)
for the same entity. In general measures of the same entity generated by different providers
are mediated to compute an average measure. Counters of events are treated differently: contributions
from different providers associated to the same counter are summed to compute a total value.Agent.getHelper(String)
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SERVICE_NAME |
Modifier and Type | Method and Description |
---|---|
void |
addCounterValueProvider(java.lang.String counterName,
CounterValueProvider provider)
Register a provider to get values of a given counter
|
void |
addEntityMeasureProvider(java.lang.String entityName,
AverageMeasureProvider provider)
Register a provider of average measures for a given entity
|
void |
addEntityMeasureProvider(java.lang.String entityName,
MeasureProvider provider)
Register a provider of measures for a given entity
|
void |
addHandler(SAMInfoHandler handler,
boolean first)
Register a new handler for SAM information collected in the Main Container.
|
void |
removeHandler(SAMInfoHandler handler)
Remove a handler for SAM information collected in the Main Container.
|
init
static final java.lang.String SERVICE_NAME
void addEntityMeasureProvider(java.lang.String entityName, MeasureProvider provider)
entityName
- The name of the entity the registered provider will provide measures forprovider
- The provider of measuresMeasureProvider
void addEntityMeasureProvider(java.lang.String entityName, AverageMeasureProvider provider)
entityName
- The name of the entity the registered provider will provide measures forprovider
- The provider of average measuresAverageMeasureProvider
,
AverageMeasureProviderImpl
void addCounterValueProvider(java.lang.String counterName, CounterValueProvider provider)
counterName
- The name of the counter the registered provider will get values ofprovider
- The provider of counter valuesCounterValueProvider
void addHandler(SAMInfoHandler handler, boolean first)
handler
- The new handler to be added.first
- A boolean indication specifying whether the new handler must be
inserted at the beginning or at the end of the list of handlers.void removeHandler(SAMInfoHandler handler)
handler
- The handler to be removed.