Package jade.core.sam
Interface SAMHelper
-
- All Superinterfaces:
ServiceHelper
public interface SAMHelper extends ServiceHelper
Helper interface for the System Activity Monitoring (SAM) Service.
The SAM Service allows collecting system activity information such as the average time to perform a given operations or the number of events of a given type. When activated, the SAM service is used internally by the JADE runtime to monitor entities related to JADE specific activities such as the average message delivery time or the number of posted messages, but can be used by application agents as well to monitor entities related to application specific activities. In order to do that an agent must retrieve theSAMHelperby means of thegetHelper()method of theAgentclass 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.- See Also:
Agent.getHelper(String)
-
-
Field Summary
Fields Modifier and Type Field Description static StringSERVICE_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddCounterValueProvider(String counterName, CounterValueProvider provider)Register a provider to get values of a given countervoidaddEntityMeasureProvider(String entityName, AverageMeasureProvider provider)Register a provider of average measures for a given entityvoidaddEntityMeasureProvider(String entityName, MeasureProvider provider)Register a provider of measures for a given entityvoidaddHandler(SAMInfoHandler handler, boolean first)Register a new handler for SAM information collected in the Main Container.voidremoveHandler(SAMInfoHandler handler)Remove a handler for SAM information collected in the Main Container.-
Methods inherited from interface jade.core.ServiceHelper
init
-
-
-
-
Field Detail
-
SERVICE_NAME
static final String SERVICE_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
addEntityMeasureProvider
void addEntityMeasureProvider(String entityName, MeasureProvider provider)
Register a provider of measures for a given entity- Parameters:
entityName- The name of the entity the registered provider will provide measures forprovider- The provider of measures- See Also:
MeasureProvider
-
addEntityMeasureProvider
void addEntityMeasureProvider(String entityName, AverageMeasureProvider provider)
Register a provider of average measures for a given entity- Parameters:
entityName- The name of the entity the registered provider will provide measures forprovider- The provider of average measures- See Also:
AverageMeasureProvider,AverageMeasureProviderImpl
-
addCounterValueProvider
void addCounterValueProvider(String counterName, CounterValueProvider provider)
Register a provider to get values of a given counter- Parameters:
counterName- The name of the counter the registered provider will get values ofprovider- The provider of counter values- See Also:
CounterValueProvider
-
addHandler
void addHandler(SAMInfoHandler handler, boolean first)
Register a new handler for SAM information collected in the Main Container. This method has no effect if called on a peripheral container- Parameters:
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.
-
removeHandler
void removeHandler(SAMInfoHandler handler)
Remove a handler for SAM information collected in the Main Container. This method has no effect if called on a peripheral container- Parameters:
handler- The handler to be removed.
-
-