Package org.apache.uima.util.impl
Class ProcessTrace_impl
java.lang.Object
org.apache.uima.util.impl.ProcessTrace_impl
- All Implemented Interfaces:
Serializable,ProcessTrace
Reference implementation of
ProcessTrace.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a ProcessTrace_impl using the framework's default timer.ProcessTrace_impl(Properties aPerformanceTuningSettings) Create a ProcessTrace_impl using the framework's default timer.ProcessTrace_impl(UimaTimer aTimer) Create a ProcessTrace_impl with a custom timer.ProcessTrace_impl(UimaTimer aTimer, Properties aPerformanceTuningSettings) Create a ProcessTrace_impl with a custom timer. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAll(List<ProcessTraceEvent> aEventList) Adds a list of completed event objects to thisProcessTrace.voidaddEvent(String aComponentName, String aType, String aDescription, int aDuration, String aResultMsg) Adds an event with the specified parameters to thisProcessTrace.voidaddEvent(ProcessTraceEvent aEvent) Adds a completed event object to thisProcessTrace.voidaggregate(ProcessTrace aProcessTrace) Aggregates the information in anotherProcessTracewith this one.protected voidaggregateEvent(ProcessTraceEvent_impl aDest, ProcessTraceEvent_impl aSrc) voidclear()Resets thisProcessTraceby removing all events.voidRecords the end of an event.protected <T extends ProcessTraceEvent>
TfindCorrespondingEvent(List<T> aEventList, T aEvent) Get a specified event.protected ProcessTraceEventgetEvent(List<ProcessTraceEvent> aEvents, String aComponentName, String aType) Gets a list ofProcessTraceEvents, in the order in which they were created.getEventsByComponentName(String aComponentName, boolean aRecurseAfterMatch) Gets all events that have the given Component name.protected voidgetEventsByComponentName(ProcessTraceEvent aEvent, String aComponentName, boolean aRecurseAfterMatch, List<ProcessTraceEvent> aResultList) Utility method used by getEventsByComponentName(String) *getEventsByType(String aType, boolean aRecurseAfterMatch) Gets all events that have the given typeprotected voidgetEventsByType(ProcessTraceEvent aEvent, String aType, boolean aRecurseAfterMatch, List<ProcessTraceEvent> aResultList) Utility method used by getEventsByType(String)voidstartEvent(String aComponentName, String aEventType, String aDescription) Records the start of an event.toString()Generates a user-readable representation of all events in thisProcessTrace.
-
Field Details
-
disabledProcessTrace
-
-
Constructor Details
-
ProcessTrace_impl
public ProcessTrace_impl()Create a ProcessTrace_impl using the framework's default timer. -
ProcessTrace_impl
Create a ProcessTrace_impl using the framework's default timer.- Parameters:
aPerformanceTuningSettings- performance tuning settings. One of the settings allows the ProcessTrace to be disabled.
-
ProcessTrace_impl
Create a ProcessTrace_impl with a custom timer.- Parameters:
aTimer- the timer to use for collecting performance stats
-
ProcessTrace_impl
Create a ProcessTrace_impl with a custom timer.- Parameters:
aTimer- the timer to use for collecting performance statsaPerformanceTuningSettings- performance tuning settings. One of the settings allows the ProcessTrace to be disabled.
-
-
Method Details
-
startEvent
Description copied from interface:ProcessTraceRecords the start of an event. The event will be ended when there is a corresponding call toProcessTrace.endEvent(String,String,String)with the same component name and event type. The duration of the event will be automatically computed from the difference in time between the start and end.- Specified by:
startEventin interfaceProcessTrace- Parameters:
aComponentName- name of the component generating the eventaEventType- type of the event. Standard types are defined as constants on theProcessTraceEventinterface, but any string may be used.aDescription- description of the event- See Also:
-
endEvent
Description copied from interface:ProcessTraceRecords the end of an event. The event is identified by the component name and type. If there is no open event that matches those values, aUIMA_IllegalStateExceptionwill be thrown.- Specified by:
endEventin interfaceProcessTrace- Parameters:
aComponentName- name of the component generating the eventaEventType- type of the event. Standard types are defined as constants on theProcessTraceEventinterface, but any string may be used.aResultMessage- describes the result of the event- See Also:
-
addEvent
public void addEvent(String aComponentName, String aType, String aDescription, int aDuration, String aResultMsg) Description copied from interface:ProcessTraceAdds an event with the specified parameters to thisProcessTrace.- Specified by:
addEventin interfaceProcessTrace- Parameters:
aComponentName- name of the component generating the eventaType- type of the event. Standard types are defined as constants on theProcessTraceEventinterface, but any string may be used.aDescription- description of the eventaDuration- duration of the event in millisecondsaResultMsg- result message of event- See Also:
-
addEvent
Description copied from interface:ProcessTraceAdds a completed event object to thisProcessTrace. This method is useful for copying events from one ProcessTrace into another.- Specified by:
addEventin interfaceProcessTrace- Parameters:
aEvent- the event object to be added to thisProcessTrace- See Also:
-
addAll
Description copied from interface:ProcessTraceAdds a list of completed event objects to thisProcessTrace. This method is useful for copying events from one ProcessTrace into another.- Specified by:
addAllin interfaceProcessTrace- Parameters:
aEventList- a List of event object to be added to thisProcessTrace- See Also:
-
getEvents
Description copied from interface:ProcessTraceGets a list ofProcessTraceEvents, in the order in which they were created. This is generally chronological order.- Specified by:
getEventsin interfaceProcessTrace- Returns:
- an unmodifiable List of
ProcessTraceEvents - See Also:
-
getEventsByComponentName
public List<ProcessTraceEvent> getEventsByComponentName(String aComponentName, boolean aRecurseAfterMatch) Description copied from interface:ProcessTraceGets all events that have the given Component name.- Specified by:
getEventsByComponentNamein interfaceProcessTrace- Parameters:
aComponentName- the component name to look foraRecurseAfterMatch- if true, all events with the given component name will be returned. If false, this method will not recurse into the sub-events of a matching event.- Returns:
- a List of ProcessTraceEvents having the given component name
- See Also:
-
getEventsByType
Description copied from interface:ProcessTraceGets all events that have the given type- Specified by:
getEventsByTypein interfaceProcessTrace- Parameters:
aType- the type of event to look foraRecurseAfterMatch- if true, all events with the given component name will be returned. If false, this method will not recurse into the sub-events of a matching event.- Returns:
- a List of ProcessTraceEvents having the given type
- See Also:
-
getEvent
Description copied from interface:ProcessTraceGet a specified event.- Specified by:
getEventin interfaceProcessTrace- Parameters:
aComponentName- name of component producing desired eventaType- type of desired event- Returns:
- the first ProcessTraceEvent matching the parameters,
nullif there is no such event. - See Also:
-
getEvent
protected ProcessTraceEvent getEvent(List<ProcessTraceEvent> aEvents, String aComponentName, String aType) -
clear
public void clear()Description copied from interface:ProcessTraceResets thisProcessTraceby removing all events.- Specified by:
clearin interfaceProcessTrace- See Also:
-
aggregate
Description copied from interface:ProcessTraceAggregates the information in anotherProcessTracewith this one. Events that exist in both ProcessTraces will have their durations added together. This method is useful for collecting aggregate performance statistics for collection processing.- Specified by:
aggregatein interfaceProcessTrace- Parameters:
aProcessTrace- the Process Trace object whose information will be combined with the information in this object- See Also:
-
toString
Description copied from interface:ProcessTraceGenerates a user-readable representation of all events in thisProcessTrace.- Specified by:
toStringin interfaceProcessTrace- Overrides:
toStringin classObject- Returns:
- the String representation of all events in this
ProcessTrace. - See Also:
-
getEventsByComponentName
protected void getEventsByComponentName(ProcessTraceEvent aEvent, String aComponentName, boolean aRecurseAfterMatch, List<ProcessTraceEvent> aResultList) Utility method used by getEventsByComponentName(String) *- Parameters:
aEvent- -aComponentName- -aRecurseAfterMatch- -aResultList- -
-
getEventsByType
protected void getEventsByType(ProcessTraceEvent aEvent, String aType, boolean aRecurseAfterMatch, List<ProcessTraceEvent> aResultList) Utility method used by getEventsByType(String)- Parameters:
aEvent- -aType- -aRecurseAfterMatch- -aResultList- -
-
findCorrespondingEvent
-
aggregateEvent
-