Class InProcessRunningSpanStore
- java.lang.Object
-
- io.opencensus.trace.export.RunningSpanStore
-
- io.opencensus.implcore.trace.export.InProcessRunningSpanStore
-
@ThreadSafe public final class InProcessRunningSpanStore extends RunningSpanStore
In-process implementation of theRunningSpanStore
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
InProcessRunningSpanStore.InProcessRunningSpanStoreImpl
-
Nested classes/interfaces inherited from class io.opencensus.trace.export.RunningSpanStore
RunningSpanStore.Filter, RunningSpanStore.PerSpanNameSummary, RunningSpanStore.Summary
-
-
Field Summary
Fields Modifier and Type Field Description private static RunningSpanStore.Summary
EMPTY_SUMMARY
private InProcessRunningSpanStore.InProcessRunningSpanStoreImpl
impl
-
Constructor Summary
Constructors Constructor Description InProcessRunningSpanStore()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static InProcessRunningSpanStore
create()
boolean
getEnabled()
Returnstrue
if the RunningSpanStore is enabled.java.util.Collection<SpanData>
getRunningSpans(RunningSpanStore.Filter filter)
Returns a list of running spans that match theFilter
.RunningSpanStore.Summary
getSummary()
Returns the summary of all available data such, as number of running spans.void
onEnd(RecordEventsSpanImpl span)
Removes theSpan
from the running spans list when theSpan
ends.void
onStart(RecordEventsSpanImpl span)
Adds theSpan
into the running spans list when theSpan
starts.void
setMaxNumberOfSpans(int maxNumberOfSpans)
Sets the maximum number of Spans in thRunningSpanStore
.
-
-
-
Field Detail
-
EMPTY_SUMMARY
private static final RunningSpanStore.Summary EMPTY_SUMMARY
-
impl
@Nullable private volatile InProcessRunningSpanStore.InProcessRunningSpanStoreImpl impl
-
-
Method Detail
-
create
static InProcessRunningSpanStore create()
-
onStart
public void onStart(RecordEventsSpanImpl span)
Adds theSpan
into the running spans list when theSpan
starts.- Parameters:
span
- theSpan
that started.
-
onEnd
public void onEnd(RecordEventsSpanImpl span)
Removes theSpan
from the running spans list when theSpan
ends.- Parameters:
span
- theSpan
that ended.
-
getEnabled
public boolean getEnabled()
Returnstrue
if the RunningSpanStore is enabled.- Returns:
true
if the RunningSpanStore is enabled.
-
getSummary
public RunningSpanStore.Summary getSummary()
Description copied from class:RunningSpanStore
Returns the summary of all available data such, as number of running spans.- Specified by:
getSummary
in classRunningSpanStore
- Returns:
- the summary of all available data.
-
getRunningSpans
public java.util.Collection<SpanData> getRunningSpans(RunningSpanStore.Filter filter)
Description copied from class:RunningSpanStore
Returns a list of running spans that match theFilter
.- Specified by:
getRunningSpans
in classRunningSpanStore
- Parameters:
filter
- used to filter the returned spans.- Returns:
- a list of running spans that match the
Filter
.
-
setMaxNumberOfSpans
public void setMaxNumberOfSpans(int maxNumberOfSpans)
Description copied from class:RunningSpanStore
Sets the maximum number of Spans in thRunningSpanStore
.0
means disabled, by default theRunningSpanStore
is disabled.- Specified by:
setMaxNumberOfSpans
in classRunningSpanStore
- Parameters:
maxNumberOfSpans
- the maximum number of Spans in thRunningSpanStore
.
-
-