Class MockSpanData

java.lang.Object
org.opensearch.test.telemetry.tracing.MockSpanData

public class MockSpanData extends Object
MockSpanData model for storing Telemetry information for testing.
  • Constructor Details

    • MockSpanData

      public MockSpanData(String spanID, String parentSpanID, String traceID, long startEpochNanos, long endEpochNanos, boolean hasEnded, String spanName, Map<String,Object> attributes)
      MockSpanData constructor with spanID, parentSpanID, traceID, startEpochNanos, endEpochNanos, hasEnded params.
      Parameters:
      spanID - spanID
      parentSpanID - spanID of the parentSpan
      traceID - traceID of the request
      startEpochNanos - startTime of span in epochNanos
      endEpochNanos - endTime of span in epochNanos
      hasEnded - value if the span is closed
      spanName - Name of the span emitted
      attributes - span attributes
    • MockSpanData

      public MockSpanData(String spanID, String parentSpanID, String traceID, long startEpochNanos, boolean hasEnded, String spanName, StackTraceElement[] stackTrace, Map<String,Object> attributes)
      MockSpanData constructor with spanID, parentSpanID, traceID, startEpochNanos, hasEnded and spanName params.
      Parameters:
      spanID - spanID
      parentSpanID - spanID of the parentSpan
      traceID - traceID of the request
      startEpochNanos - startTime of span in epochNanos
      hasEnded - value if the span is closed
      spanName - Name of the span emitted
      stackTrace - StackTrace to debug the problematic span
      attributes - span attributes
  • Method Details

    • getSpanID

      public String getSpanID()
      Returns SpanID.
    • getParentSpanID

      public String getParentSpanID()
      Returns ParentSpanID.
    • getTraceID

      public String getTraceID()
      Returns TraceID.
    • isHasEnded

      public boolean isHasEnded()
      Returns hasEnded.
    • getEndEpochNanos

      public long getEndEpochNanos()
      Returns EndEpochNanos for a span.
    • getStartEpochNanos

      public long getStartEpochNanos()
      Returns StartEpochNanos for a span.
    • getStackTrace

      public StackTraceElement[] getStackTrace()
      Returns StackTrace for a span.
    • setEndEpochNanos

      public void setEndEpochNanos(long endEpochNanos)
      Sets EndEpochNanos for a span.
      Parameters:
      endEpochNanos - endtime in epoch nanos
    • setHasEnded

      public void setHasEnded(boolean hasEnded)
      Sets hasEnded for a span.
      Parameters:
      hasEnded - hasEnded value if span is closed.
    • getAttributes

      public Map<String,Object> getAttributes()
      Returns the attributes
      Returns:
      returns the attributes map.
    • toString

      public String toString()
      Overrides:
      toString in class Object