Package 

Interface Span

  • All Implemented Interfaces:
    com.bugsnag.android.performance.HasAttributes , com.bugsnag.android.performance.SpanContext , java.io.Closeable , java.lang.AutoCloseable

    
    public interface Span
     implements SpanContext, Closeable, HasAttributes
                        

    Represents an ongoing or complete performance measurement and the associated attributes. Spans are typically used in a try-with-resources in Java, or with the use extension function in Kotlin to ensure they are closed.

    Spans may not be changed once they have been closed.

    The Span interface is not intended for third-party implementation.

    • Method Summary

      Modifier and Type Method Description
      abstract Unit end(Long endTime) End this with a specified timestamp relative to SystemClock.elapsedRealtimeNanos.
      abstract Unit end() End this span now.
      Unit close() Convenience function to call end, implementing the Closeable interface and allowing Span to be used with try-with-resources in Java.
      abstract Boolean isEnded() Returns true if this span has been closed / ended.
      abstract String getName() The name of this span.
      abstract Long getSpanId()
      abstract UUID getTraceId()
      • Methods inherited from class com.bugsnag.android.performance.Span

        setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, wrap, wrap
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • end

         abstract Unit end()

        End this span now. This is the same as end(SystemClock.elapsedRealtimeNanos()).

      • close

         Unit close()

        Convenience function to call end, implementing the Closeable interface and allowing Span to be used with try-with-resources in Java.

      • isEnded

         abstract Boolean isEnded()

        Returns true if this span has been closed / ended. If this returns true the span cannot be modified further.