Package io.grpc.internal.testing
Class StatsTestUtils.MockableSpan
java.lang.Object
io.opencensus.trace.Span
io.grpc.internal.testing.StatsTestUtils.MockableSpan
- Enclosing class:
StatsTestUtils
public static class StatsTestUtils.MockableSpan
extends io.opencensus.trace.Span
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Mockable implementation for theSpanBuilder
class.Nested classes/interfaces inherited from class io.opencensus.trace.Span
io.opencensus.trace.Span.Kind, io.opencensus.trace.Span.Options
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
MockableSpan
(io.opencensus.trace.SpanContext context, EnumSet<io.opencensus.trace.Span.Options> options) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAnnotation
(io.opencensus.trace.Annotation annotation) void
addAnnotation
(String description, Map<String, io.opencensus.trace.AttributeValue> attributes) void
addLink
(io.opencensus.trace.Link link) void
addMessageEvent
(io.opencensus.trace.MessageEvent messageEvent) void
end
(io.opencensus.trace.EndSpanOptions options) static StatsTestUtils.MockableSpan
generateRandomSpan
(Random random) Creates a MockableSpan with a random trace ID and span ID.void
putAttributes
(Map<String, io.opencensus.trace.AttributeValue> attributes) Methods inherited from class io.opencensus.trace.Span
addAnnotation, addAttributes, addNetworkEvent, end, getContext, getOptions, putAttribute, setStatus
-
Constructor Details
-
MockableSpan
-
-
Method Details
-
generateRandomSpan
Creates a MockableSpan with a random trace ID and span ID. -
putAttributes
- Overrides:
putAttributes
in classio.opencensus.trace.Span
-
addAnnotation
public void addAnnotation(String description, Map<String, io.opencensus.trace.AttributeValue> attributes) - Specified by:
addAnnotation
in classio.opencensus.trace.Span
-
addAnnotation
public void addAnnotation(io.opencensus.trace.Annotation annotation) - Specified by:
addAnnotation
in classio.opencensus.trace.Span
-
addMessageEvent
public void addMessageEvent(io.opencensus.trace.MessageEvent messageEvent) - Overrides:
addMessageEvent
in classio.opencensus.trace.Span
-
addLink
public void addLink(io.opencensus.trace.Link link) - Specified by:
addLink
in classio.opencensus.trace.Span
-
end
public void end(io.opencensus.trace.EndSpanOptions options) - Specified by:
end
in classio.opencensus.trace.Span
-