public interface

Tracer.Span

implements java.io.Closeable

 androidx.test.platform.tracing.Tracer.Span

Overview

Span is a helper object denoting an ongoing time span and providing a way for the caller to close and end the span to record the end of the action being traced.

The Span interface implements java.io.Closeable to encourage its use in a try-resource block and ensure that the Tracer.Span.close() method is always properly called.

Summary

Methods
public Tracer.SpanbeginChildSpan(java.lang.String name)

Starts a new time span nested in a parent span, to track progression of some inner action.

public voidclose()

Closes and ends this span.

Methods

public Tracer.Span beginChildSpan(java.lang.String name)

Starts a new time span nested in a parent span, to track progression of some inner action.

The implementation must return a Tracer.Span object which the caller must use later to close and end the span.

Multiple child spans can be created for the same parent span. It is expected that the child spans do not overlap.

Parameters:

name: A name describing the inner action performed.

Returns:

A new span object that the caller must invoke later to close the span.

public void close()

Closes and ends this span.

Callers must not interact any further with this span.