Class RequestTrace

    • Constructor Detail

      • RequestTrace

        public RequestTrace()
    • Method Detail

      • addEvent

        public void addEvent​(RequestTraceSpan span)
        Add a new event to the series being traced
        Parameters:
        span -
      • addEvent

        public void addEvent​(RequestTraceSpan span,
                             long timestampMillis)
      • endTrace

        public void endTrace()
      • endTrace

        public void endTrace​(long timestampMillis)
      • getElapsedTime

        public long getElapsedTime()
        Gets how long the trace took. If the trace has not finished then this will be 0.
        Returns:
        Time for trace in milliseconds
      • isStarted

        public boolean isStarted()
        Returns true if a trace has started. This will return true even if the trace has completed.
        Returns:
      • getTraceSpans

        public LinkedList<RequestTraceSpan> getTraceSpans()
        Returns a list of all the events that make up the trace.
        Returns:
        A list containing all of the Spans that constitute this trace.
      • getStartTime

        public Instant getStartTime()
        Gets the Instant when the span was started See Instant.now() for how this time is generated.
        Returns:
        The Instant for when this span was started.
      • getEndTime

        public Instant getEndTime()
        Gets the end time of the request trace in milliseconds since the epoch (midnight, January 1st 1970).

        This value is 0 until the request trace in finished.

        Returns:
      • getTraceId

        public UUID getTraceId()
        Returns a unique identifier for the trace, which comes from the first event.
        Returns:
        null if no trace started
      • setTraceId

        public void setTraceId​(UUID newID)
      • isCompleted

        public boolean isCompleted()
        Returns true if a complete trace has finished
        Returns:
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object