Class AnalysisEngineManagementImpl
java.lang.Object
org.apache.uima.analysis_engine.impl.AnalysisEngineManagementImpl
- All Implemented Interfaces:
Serializable,AnalysisEngineManagement,AnalysisEngineManagementImplMBean,ManagementObject
public class AnalysisEngineManagementImpl
extends Object
implements AnalysisEngineManagementImplMBean, AnalysisEngineManagement
Implements Monitoring/Management interface to an AnalysisEngine.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.uima.analysis_engine.AnalysisEngineManagement
AnalysisEngineManagement.State -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddComponent(String key, AnalysisEngineManagementImpl component) longGets the total time this AnalysisEngine has spent doing analysis over its entire lifetime.longInternal use only.longGets the total time this AnalysisEngine has spent in its batchProcessComplete method over its entire lifetime.longInternal use only.Gets the throughput of this AnalysisEngine, represented as number of CASes processed per second.longGets the total time this AnalysisEngine has spent in its collectionProcessComplete method over its entire lifetime.longInternal use only.For an Aggregate AnalysisEngine, gets a Map whose values are AnalysisEngineManagement objects that contain the statistics for the components of the aggregate.longTotal time it took AnalysisEngine to initializegetName()Gets a name for this AnalysisEngineManagement object, which will be unique among all of its siblings (i.e.longGets the total number of CASes this AnalysisEngine has processed over its lifetime.longIf this AnalysisEngine is a proxy to a remote service, gets the total time spent making calls on that service.longInternal use only.getState()Gets the current state of an AnalysisEngine.longGets an id of a thread that was used to initialize AE instanceGets a valid JMX MBean name that is unique among all ManagementObjects in this JVM.voidvoidmark()Internal use only.voidreportAnalysisTime(long time) voidreportBatchProcessCompleteTime(long time) voidreportCollectionProcessCompleteTime(long time) voidreportServiceCallTime(long time) voidResets all of the performance statistics to zero.voidsetInitializationTime(long initializationTime) voidsetName(String aName, UimaContextAdmin aContext, String aCustomPrefix) Sets the name of this AnalyaisEngineManagement object, and also computes the unique MBean name that can later be used to register this object with an MBeanServer.void
-
Constructor Details
-
AnalysisEngineManagementImpl
public AnalysisEngineManagementImpl()
-
-
Method Details
-
getInitializationTime
public long getInitializationTime()Description copied from interface:AnalysisEngineManagementTotal time it took AnalysisEngine to initialize- Specified by:
getInitializationTimein interfaceAnalysisEngineManagement- Specified by:
getInitializationTimein interfaceAnalysisEngineManagementImplMBean- Returns:
- - initialization time
-
setInitializationTime
public void setInitializationTime(long initializationTime) -
getThreadId
public long getThreadId()Description copied from interface:AnalysisEngineManagementGets an id of a thread that was used to initialize AE instance- Specified by:
getThreadIdin interfaceAnalysisEngineManagement- Specified by:
getThreadIdin interfaceAnalysisEngineManagementImplMBean- Returns:
- - thread id
-
getState
Description copied from interface:AnalysisEngineManagementGets the current state of an AnalysisEngine. The AE should either be in Initializing or Ready state.- Specified by:
getStatein interfaceAnalysisEngineManagement- Specified by:
getStatein interfaceAnalysisEngineManagementImplMBean- Returns:
- the state of the analysis engine, from the State enum above
-
setState
-
reportAnalysisTime
public void reportAnalysisTime(long time) -
reportBatchProcessCompleteTime
public void reportBatchProcessCompleteTime(long time) -
reportCollectionProcessCompleteTime
public void reportCollectionProcessCompleteTime(long time) -
reportServiceCallTime
public void reportServiceCallTime(long time) -
incrementCASesProcessed
public void incrementCASesProcessed() -
getBatchProcessCompleteTime
public long getBatchProcessCompleteTime()Description copied from interface:AnalysisEngineManagementGets the total time this AnalysisEngine has spent in its batchProcessComplete method over its entire lifetime.- Specified by:
getBatchProcessCompleteTimein interfaceAnalysisEngineManagement- Specified by:
getBatchProcessCompleteTimein interfaceAnalysisEngineManagementImplMBean- Returns:
- the batch process complete time in milliseconds
-
getCollectionProcessCompleteTime
public long getCollectionProcessCompleteTime()Description copied from interface:AnalysisEngineManagementGets the total time this AnalysisEngine has spent in its collectionProcessComplete method over its entire lifetime.- Specified by:
getCollectionProcessCompleteTimein interfaceAnalysisEngineManagement- Specified by:
getCollectionProcessCompleteTimein interfaceAnalysisEngineManagementImplMBean- Returns:
- the batch process complete time in milliseconds
-
getAnalysisTime
public long getAnalysisTime()Description copied from interface:AnalysisEngineManagementGets the total time this AnalysisEngine has spent doing analysis over its entire lifetime. This includes calls to theAnalysisEngine.process(CAS)andAnalysisEngine.processAndOutputNewCASes(CAS)methods, as well as calls to the CasIterator returned from the processAndOutputNewCASes method.- Specified by:
getAnalysisTimein interfaceAnalysisEngineManagement- Specified by:
getAnalysisTimein interfaceAnalysisEngineManagementImplMBean- Returns:
- the analysis time time in milliseconds
-
getServiceCallTime
public long getServiceCallTime()Description copied from interface:AnalysisEngineManagementIf this AnalysisEngine is a proxy to a remote service, gets the total time spent making calls on that service.- Specified by:
getServiceCallTimein interfaceAnalysisEngineManagement- Specified by:
getServiceCallTimein interfaceAnalysisEngineManagementImplMBean- Returns:
- the service call time in milliseconds, or 0 if this AnalysisEngine is not a proxy to a service
-
mark
public void mark()Internal use only. Used to implement backwards compatibility with the ProcessTrace interface. -
getBatchProcessCompleteTimeSinceMark
public long getBatchProcessCompleteTimeSinceMark()Internal use only. Used to implement backwards compatibility with the ProcessTrace interface.- Returns:
- Batch Process Complete time since mark
-
getCollectionProcessCompleteTimeSinceMark
public long getCollectionProcessCompleteTimeSinceMark()Internal use only. Used to implement backwards compatibility with the ProcessTrace interface.- Returns:
- Collection Process Complete time since mark
-
getAnalysisTimeSinceMark
public long getAnalysisTimeSinceMark()Internal use only. Used to implement backwards compatibility with the ProcessTrace interface.- Returns:
- Analysis time since mark
-
getServiceCallTimeSinceMark
public long getServiceCallTimeSinceMark()Internal use only. Used to implement backwards compatibility with the ProcessTrace interface.- Returns:
- service call time since mark
-
getNumberOfCASesProcessed
public long getNumberOfCASesProcessed()Description copied from interface:AnalysisEngineManagementGets the total number of CASes this AnalysisEngine has processed over its lifetime. For a CAS Multipliers, this includes both input and output CASes.- Specified by:
getNumberOfCASesProcessedin interfaceAnalysisEngineManagement- Specified by:
getNumberOfCASesProcessedin interfaceAnalysisEngineManagementImplMBean- Returns:
- the number of CASes processed
-
getCASesPerSecond
Description copied from interface:AnalysisEngineManagementGets the throughput of this AnalysisEngine, represented as number of CASes processed per second.- Specified by:
getCASesPerSecondin interfaceAnalysisEngineManagement- Specified by:
getCASesPerSecondin interfaceAnalysisEngineManagementImplMBean- Returns:
- a string representation of the throughput
-
getComponents
Description copied from interface:AnalysisEngineManagementFor an Aggregate AnalysisEngine, gets a Map whose values are AnalysisEngineManagement objects that contain the statistics for the components of the aggregate. The keys in the Map are the unique String keys specified in the aggregate AnalysisEngine descriptor. If this AnalysisEngine is a primitive, returns an empty Map.- Specified by:
getComponentsin interfaceAnalysisEngineManagement- Returns:
- a map from String keys to AnalysisEngineManagement objects
-
addComponent
-
getName
Description copied from interface:AnalysisEngineManagementGets a name for this AnalysisEngineManagement object, which will be unique among all of its siblings (i.e. the objects returned from its parent'sAnalysisEngineManagement.getComponents()method.- Specified by:
getNamein interfaceAnalysisEngineManagement- Specified by:
getNamein interfaceAnalysisEngineManagementImplMBean- Returns:
- a name for this AnalysisEngineManagement object
-
getUniqueMBeanName
Description copied from interface:ManagementObjectGets a valid JMX MBean name that is unique among all ManagementObjects in this JVM. (Technically, it is unique only among ManagementObjects objects loaded by the same ClassLoader, which is whatever ClassLoader was used to load the UIMA Framework classes.)If you are running with JRE 1.5, this is the name used to register this object with the platform MBeanServer.
- Specified by:
getUniqueMBeanNamein interfaceManagementObject- Returns:
- a unique MBean name
-
resetStats
public void resetStats()Description copied from interface:AnalysisEngineManagementResets all of the performance statistics to zero. For an Aggregate Analysis Engine, also resets the statistics for all the components of the aggregate.- Specified by:
resetStatsin interfaceAnalysisEngineManagement- Specified by:
resetStatsin interfaceAnalysisEngineManagementImplMBean
-
setName
Sets the name of this AnalyaisEngineManagement object, and also computes the unique MBean name that can later be used to register this object with an MBeanServer.- Parameters:
aName- the simple name of this AnalysisEngine (generally this is thenameproperty from the AnalysisEngineMetaData)aContext- the UimaContext for this AnalysisEngine. Needed to compute the unique name, which is hierarchicalaCustomPrefix- an optional prefix provided by the Application, which will be prepended to the name generated by UIMA. If null, the prefix "org.apache.uima:" will be used.
-