{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}
interface Tracer.Span extends Closeable
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 Closeable to encourage its use in a try-resource block and ensure that the close method is always properly called.
Public methods |
|
|---|---|
abstract Tracer.Span |
beginChildSpan(String name)Starts a new time span nested in a parent span, to track progression of some inner action. |
abstract void |
close()Closes and ends this span. |
abstract Tracer.Span beginChildSpan(String name)
Starts a new time span nested in a parent span, to track progression of some inner action.
The implementation must return a 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 | |
|---|---|
String name |
A name describing the inner action performed. |
| Returns | |
|---|---|
Tracer.Span |
A new span object that the caller must invoke later to close the span. |
abstract void close()
Closes and ends this span.
Callers must not interact any further with this span.