Interface ProcessTrace

  • All Superinterfaces:
    java.io.Serializable
    All Known Implementing Classes:
    ProcessTrace_impl

    public interface ProcessTrace
    extends java.io.Serializable
    A ProcessTrace object keeps a record of events that have occurred and information, such as timing, about those events.

    Each event is represented by a ProcessTraceEvent object. Events may have sub-events, so a ProcessTrace is really a forest of events, which provides a useful description of where time is spent during a process involving several components.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addAll​(java.util.List<ProcessTraceEvent> aEventList)
      Adds a list of completed event objects to this ProcessTrace.
      void addEvent​(java.lang.String aResourceName, java.lang.String aType, java.lang.String aDescription, int aDuration, java.lang.String aResultMsg)
      Adds an event with the specified parameters to this ProcessTrace.
      void addEvent​(ProcessTraceEvent aEvent)
      Adds a completed event object to this ProcessTrace.
      void aggregate​(ProcessTrace aProcessTrace)
      Aggregates the information in another ProcessTrace with this one.
      void clear()
      Resets this ProcessTrace by removing all events.
      void endEvent​(java.lang.String aComponentName, java.lang.String aEventType, java.lang.String aResultMessage)
      Records the end of an event.
      ProcessTraceEvent getEvent​(java.lang.String aComponentName, java.lang.String aType)
      Get a specified event.
      java.util.List<ProcessTraceEvent> getEvents()
      Gets a list of ProcessTraceEvents, in the order in which they were created.
      java.util.List<ProcessTraceEvent> getEventsByComponentName​(java.lang.String aComponentName, boolean aRecurseWithinMatch)
      Gets all events that have the given Component name.
      java.util.List<ProcessTraceEvent> getEventsByType​(java.lang.String aType, boolean aRecurseWithinMatch)
      Gets all events that have the given type
      void startEvent​(java.lang.String aComponentName, java.lang.String aEventType, java.lang.String aDescription)
      Records the start of an event.
      java.lang.String toString()
      Generates a user-readable representation of all events in this ProcessTrace.
    • Method Detail

      • startEvent

        void startEvent​(java.lang.String aComponentName,
                        java.lang.String aEventType,
                        java.lang.String aDescription)
        Records the start of an event. The event will be ended when there is a corresponding call to 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.
        Parameters:
        aComponentName - name of the component generating the event
        aEventType - type of the event. Standard types are defined as constants on the ProcessTraceEvent interface, but any string may be used.
        aDescription - description of the event
      • endEvent

        void endEvent​(java.lang.String aComponentName,
                      java.lang.String aEventType,
                      java.lang.String aResultMessage)
        Records 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, a UIMA_IllegalStateException will be thrown.
        Parameters:
        aComponentName - name of the component generating the event
        aEventType - 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 event
        Throws:
        UIMA_IllegalStateException - if there is no open event matching the aComponentName and aEventType arguments.
      • addEvent

        void addEvent​(java.lang.String aResourceName,
                      java.lang.String aType,
                      java.lang.String aDescription,
                      int aDuration,
                      java.lang.String aResultMsg)
        Adds an event with the specified parameters to this ProcessTrace.
        Parameters:
        aResourceName - name of the component generating the event
        aType - type of the event. Standard types are defined as constants on the ProcessTraceEvent interface, but any string may be used.
        aDescription - description of the event
        aDuration - duration of the event in milliseconds
        aResultMsg - result message of event
      • addEvent

        void addEvent​(ProcessTraceEvent aEvent)
        Adds a completed event object to this ProcessTrace. This method is useful for copying events from one ProcessTrace into another.
        Parameters:
        aEvent - the event object to be added to this ProcessTrace
      • addAll

        void addAll​(java.util.List<ProcessTraceEvent> aEventList)
        Adds a list of completed event objects to this ProcessTrace. This method is useful for copying events from one ProcessTrace into another.
        Parameters:
        aEventList - a List of event object to be added to this ProcessTrace
      • getEventsByComponentName

        java.util.List<ProcessTraceEvent> getEventsByComponentName​(java.lang.String aComponentName,
                                                                   boolean aRecurseWithinMatch)
        Gets all events that have the given Component name.
        Parameters:
        aComponentName - the component name to look for
        aRecurseWithinMatch - 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
      • getEventsByType

        java.util.List<ProcessTraceEvent> getEventsByType​(java.lang.String aType,
                                                          boolean aRecurseWithinMatch)
        Gets all events that have the given type
        Parameters:
        aType - the type of event to look for
        aRecurseWithinMatch - 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
      • getEvent

        ProcessTraceEvent getEvent​(java.lang.String aComponentName,
                                   java.lang.String aType)
        Get a specified event.
        Parameters:
        aComponentName - name of component producing desired event
        aType - type of desired event
        Returns:
        the first ProcessTraceEvent matching the parameters, null if there is no such event.
      • clear

        void clear()
        Resets this ProcessTrace by removing all events.
      • aggregate

        void aggregate​(ProcessTrace aProcessTrace)
        Aggregates the information in another 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.
        Parameters:
        aProcessTrace - the Process Trace object whose information will be combined with the information in this object
      • toString

        java.lang.String toString()
        Generates a user-readable representation of all events in this ProcessTrace.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the String representation of all events in this ProcessTrace.