org.apache.uima.util

## Interface ProcessTraceEvent

- All Superinterfaces:
    Serializable
  All Known Implementing Classes:
    ProcessTraceEvent_impl

      public interface ProcessTraceEvent
      extends Serializable

  Captures information, including timing, about an event that occurred during processing. Events may have sub-events that further break down the steps involved in a complex process.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ANALYSIS` Constant for the ANALYSIS event type.
    `static String` | `ANALYSIS_ENGINE` Constant for the ANALYSIS_ENGINE event type.
    `static String` | `SERVICE` Constant for the SERVICE event type.
    `static String` | `SERVICE_CALL` Constant for the SERVICE_CALL event type.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getComponentName()` Retrieves the name of the component that is performing this event.
    `String` | `getDescription()` Retrieves the description of this event.
    `int` | `getDuration()` Gets the duration of this event.
    `int` | `getDurationExcludingSubEvents()` Gets the duration of this event, minus the sum of the durations of its direct sub-events.
    `String` | `getResultMessage()` Retrieves the result message of this event.
    `List<ProcessTraceEvent>` | `getSubEvents()` Gets the sub-events of this event.
    `String` | `getType()` Gets the type of event.
    `String` | `toString()` Generates a user-readable representation of this event and its sub-events.
    `void` | `toString(StringBuffer aBuf, int aIndentLevel)` Generates a user-readable representation of this event and its subevents, using the given indentation level and writing to a StringBuffer.
    `void` | `toString(StringBuffer aBuf, int aIndentLevel, int aTotalTime)` Generates a user-readable representation of this event and its subevents, using the given indentation level and writing to a StringBuffer.

- - ### Field Detail

    - #### ANALYSIS_ENGINE

          static final String ANALYSIS_ENGINE

      Constant for the ANALYSIS_ENGINE event type. This represents the time spent in the Analysis Engine, including the annotator's analysis and framework overhead.
      See Also:
        Constant Field Values

    - #### ANALYSIS

          static final String ANALYSIS

      Constant for the ANALYSIS event type. This represents the actual analysis performed by an annotator.
      See Also:
        Constant Field Values

    - #### SERVICE

          static final String SERVICE

      Constant for the SERVICE event type. This represents the total time spent in execution of a remote service (not including communication and marshalling/unmarshalling overhead).
      See Also:
        Constant Field Values

    - #### SERVICE_CALL

          static final String SERVICE_CALL

      Constant for the SERVICE_CALL event type. This represents the total time spent making a call on a remote service, including marshalling and unmarshalling.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getComponentName

          String getComponentName()

      Retrieves the name of the component that is performing this event.
      Returns:
        the component name

    - #### getType

          String getType()

      Gets the type of event. Standard values for this property are defined as constants on this interface, but any String is allowed.
      Returns:
        the event type

    - #### getDescription

          String getDescription()

      Retrieves the description of this event.
      Returns:
        the event Description

    - #### getDuration

          int getDuration()

      Gets the duration of this event.
      Returns:
        the duration of this event, in milliseconds.

    - #### getResultMessage

          String getResultMessage()

      Retrieves the result message of this event.
      Returns:
        the event's result message

    - #### getSubEvents

          List<ProcessTraceEvent> getSubEvents()

      Gets the sub-events of this event.
      Returns:
        a List containing other `ProcessTraceEvent` objects

    - #### getDurationExcludingSubEvents

          int getDurationExcludingSubEvents()

      Gets the duration of this event, minus the sum of the durations of its direct sub-events.
      Returns:
        the duration of this event in milliseconds, excluding the time spent in its sub-events

    - #### toString

          String toString()

      Generates a user-readable representation of this event and its sub-events.
      Overrides:
        `toString` in class `Object`
      Returns:
        the String representation of this event and its sub-events

    - #### toString

          void toString(StringBuffer aBuf,
                        int aIndentLevel)

      Generates a user-readable representation of this event and its subevents, using the given indentation level and writing to a StringBuffer. This is useful for writing nested events.
      Parameters:
        `aBuf` - string buffer to add to
        `aIndentLevel` - indentation level

    - #### toString

          void toString(StringBuffer aBuf,
                        int aIndentLevel,
                        int aTotalTime)

      Generates a user-readable representation of this event and its subevents, using the given indentation level and writing to a StringBuffer. Also, if the total time for all events is known, this method will print the percentage of time used by this event and its subevents.
      Parameters:
        `aBuf` - string buffer to add to
        `aIndentLevel` - indentation level
        `aTotalTime` - total time, used to calculate percentags. If not known, pass 0.

Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.