public class ProcessTrace_impl extends Object implements ProcessTrace
ProcessTrace
.Modifier and Type | Field and Description |
---|---|
static ProcessTrace |
disabledProcessTrace |
Constructor and Description |
---|
ProcessTrace_impl()
Create 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.
|
Modifier and Type | Method and Description |
---|---|
void |
addAll(List<ProcessTraceEvent> aEventList)
Adds a list of completed event objects to this
ProcessTrace . |
void |
addEvent(ProcessTraceEvent aEvent)
Adds a completed event object to this
ProcessTrace . |
void |
addEvent(String aComponentName,
String aType,
String aDescription,
int aDuration,
String aResultMsg)
Adds an event with the specified parameters to this
ProcessTrace . |
void |
aggregate(ProcessTrace aProcessTrace)
Aggregates the information in another
ProcessTrace with this one. |
protected void |
aggregateEvent(ProcessTraceEvent_impl aDest,
ProcessTraceEvent_impl aSrc) |
void |
clear()
Resets this
ProcessTrace by removing all events. |
void |
endEvent(String aComponentName,
String aEventType,
String aResultMessage)
Records the end of an event.
|
protected <T extends ProcessTraceEvent> |
findCorrespondingEvent(List<T> aEventList,
T aEvent) |
protected ProcessTraceEvent |
getEvent(List<ProcessTraceEvent> aEvents,
String aComponentName,
String aType) |
ProcessTraceEvent |
getEvent(String aComponentName,
String aType)
Get a specified event.
|
List<ProcessTraceEvent> |
getEvents()
Gets a list of
ProcessTraceEvent s, in the order in which they were created. |
protected void |
getEventsByComponentName(ProcessTraceEvent aEvent,
String aComponentName,
boolean aRecurseAfterMatch,
List<ProcessTraceEvent> aResultList)
Utility method used by getEventsByComponentName(String) *
|
List<ProcessTraceEvent> |
getEventsByComponentName(String aComponentName,
boolean aRecurseAfterMatch)
Gets all events that have the given Component name.
|
protected void |
getEventsByType(ProcessTraceEvent aEvent,
String aType,
boolean aRecurseAfterMatch,
List<ProcessTraceEvent> aResultList)
Utility method used by getEventsByType(String)
|
List<ProcessTraceEvent> |
getEventsByType(String aType,
boolean aRecurseAfterMatch)
Gets all events that have the given type
|
void |
startEvent(String aComponentName,
String aEventType,
String aDescription)
Records the start of an event.
|
String |
toString()
Generates a user-readable representation of all events in this
ProcessTrace . |
public static ProcessTrace disabledProcessTrace
public ProcessTrace_impl()
public ProcessTrace_impl(Properties aPerformanceTuningSettings)
aPerformanceTuningSettings
- performance tuning settings. One of the settings allows the ProcessTrace to be
disabled.public ProcessTrace_impl(UimaTimer aTimer)
aTimer
- the timer to use for collecting performance statspublic ProcessTrace_impl(UimaTimer aTimer, Properties aPerformanceTuningSettings)
aTimer
- the timer to use for collecting performance statsaPerformanceTuningSettings
- performance tuning settings. One of the settings allows the ProcessTrace to be
disabled.public void startEvent(String aComponentName, String aEventType, String aDescription)
ProcessTrace
ProcessTrace.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.startEvent
in interface ProcessTrace
aComponentName
- name of the component generating the eventaEventType
- type of the event. Standard types are defined as constants on the
ProcessTraceEvent
interface, but any string may be used.aDescription
- description of the eventProcessTrace.startEvent(java.lang.String, java.lang.String,
java.lang.String)
public void endEvent(String aComponentName, String aEventType, String aResultMessage)
ProcessTrace
UIMA_IllegalStateException
will be
thrown.endEvent
in interface ProcessTrace
aComponentName
- name of the component generating the eventaEventType
- type of the event. Standard types are defined as constants on the
ProcessTraceEvent
interface, but any string may be used.aResultMessage
- describes the result of the eventProcessTrace.endEvent(java.lang.String, java.lang.String,
java.lang.String)
public void addEvent(String aComponentName, String aType, String aDescription, int aDuration, String aResultMsg)
ProcessTrace
ProcessTrace
.addEvent
in interface ProcessTrace
aComponentName
- name of the component generating the eventaType
- type of the event. Standard types are defined as constants on the
ProcessTraceEvent
interface, but any string may be used.aDescription
- description of the eventaDuration
- duration of the event in millisecondsaResultMsg
- result message of eventProcessTrace.addEvent(String, String, String, int, String)
public void addEvent(ProcessTraceEvent aEvent)
ProcessTrace
ProcessTrace
. This method is useful for
copying events from one ProcessTrace into another.addEvent
in interface ProcessTrace
aEvent
- the event object to be added to this ProcessTrace
ProcessTrace.addEvent(org.apache.uima.util.ProcessTraceEvent)
public void addAll(List<ProcessTraceEvent> aEventList)
ProcessTrace
ProcessTrace
. This method is
useful for copying events from one ProcessTrace into another.addAll
in interface ProcessTrace
aEventList
- a List of event object to be added to this ProcessTrace
ProcessTrace.addAll(java.util.List)
public List<ProcessTraceEvent> getEvents()
ProcessTrace
ProcessTraceEvent
s, in the order in which they were created. This is
generally chronological order.getEvents
in interface ProcessTrace
ProcessTraceEvent
sProcessTrace.getEvents()
public List<ProcessTraceEvent> getEventsByComponentName(String aComponentName, boolean aRecurseAfterMatch)
ProcessTrace
getEventsByComponentName
in interface ProcessTrace
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.ProcessTrace.getEventsByComponentName(String, boolean)
public List<ProcessTraceEvent> getEventsByType(String aType, boolean aRecurseAfterMatch)
ProcessTrace
getEventsByType
in interface ProcessTrace
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.ProcessTrace.getEventsByType(String, boolean)
public ProcessTraceEvent getEvent(String aComponentName, String aType)
ProcessTrace
getEvent
in interface ProcessTrace
aComponentName
- name of component producing desired eventaType
- type of desired eventnull
if there is no
such event.ProcessTrace.getEvent(String, String)
protected ProcessTraceEvent getEvent(List<ProcessTraceEvent> aEvents, String aComponentName, String aType)
public void clear()
ProcessTrace
ProcessTrace
by removing all events.clear
in interface ProcessTrace
ProcessTrace.clear()
public void aggregate(ProcessTrace aProcessTrace)
ProcessTrace
ProcessTrace
with 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.aggregate
in interface ProcessTrace
aProcessTrace
- the Process Trace object whose information will be combined with the information in
this objectProcessTrace.aggregate(org.apache.uima.util.ProcessTrace)
public String toString()
ProcessTrace
ProcessTrace
.toString
in interface ProcessTrace
toString
in class Object
ProcessTrace
.ProcessTrace.toString()
protected void getEventsByComponentName(ProcessTraceEvent aEvent, String aComponentName, boolean aRecurseAfterMatch, List<ProcessTraceEvent> aResultList)
aEvent
- -aComponentName
- -aRecurseAfterMatch
- -aResultList
- -protected void getEventsByType(ProcessTraceEvent aEvent, String aType, boolean aRecurseAfterMatch, List<ProcessTraceEvent> aResultList)
aEvent
- -aType
- -aRecurseAfterMatch
- -aResultList
- -protected <T extends ProcessTraceEvent> T findCorrespondingEvent(List<T> aEventList, T aEvent)
protected void aggregateEvent(ProcessTraceEvent_impl aDest, ProcessTraceEvent_impl aSrc)
Copyright © 2006–2021 The Apache Software Foundation. All rights reserved.