java.lang.Object
com.github.beothorn.agent.recorder.Span

public class Span extends Object
  • Field Details

    • counter

      public static final AtomicLong counter
    • entryTime

      public final long entryTime
    • exitTime

      public long exitTime
    • returnValue

      public String[] returnValue
    • arguments

      public final String[][] arguments
  • Constructor Details

  • Method Details

    • span

      public static Span span(String name, String className, String method, long entryTime, String[][] arguments)
    • span

      public static Span span(String name, String className, String method, long entryTime, String[][] arguments, String stackTrace)
    • span

      public static Span span(String name, String className, String method, long entryTime, String[][] arguments, Span parent, String stackTrace)
    • enter

      public Span enter(String name, String className, String method, long entryTime)
    • enter

      public Span enter(String name, String className, String method, long entryTime, String[][] arguments, String stacktrace)
    • getRoot

      public Span getRoot()
    • leave

      public Span leave(long exitTime)
    • leave

      public Span leave(long exitTime, String[] returnValue)
      To be called after the span has exited.
      Parameters:
      exitTime - The exit timestamp of the span.
      returnValue - An array with two elements, the return type and the return value.
      Returns:
      Itself
    • toJson

      public String toJson()
    • escapeString

      public static String escapeString(String nameMaybeWithReturn)
    • description

      public String description()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • removeFinishedFunction

      public Optional<Span> removeFinishedFunction()
      Remove old spans and keep only the current active span. This is the last child branch.
      Returns:
      the non-active branch