Package zipkin2
Class TestObjects
- java.lang.Object
-
- zipkin2.TestObjects
-
public final class TestObjects extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static EndpointBACKENDstatic SpanCLIENT_SPANOnly for unit tests, not integration tests.static longDAYNotably, the cassandra implementation has day granularitystatic EndpointDBstatic EndpointFRONTENDstatic EndpointKAFKAstatic Span[]LOTS_OF_SPANSZipkin trace ids are random 64bit numbers.static longTODAYstatic List<Span>TRACEOnly for unit tests, not integration tests.static CharsetUTF_8
-
Constructor Summary
Constructors Constructor Description TestObjects()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringappendSuffix(String serviceName, String serviceNameSuffix)static longendTs(List<Span> trace)static longmidnightUTC(long epochMillis)For bucketed data floored to the day.static SpannewClientSpan(String serviceNameSuffix)static List<Span>newTrace(String serviceNameSuffix)static StringnewTraceId()static Spanspan(long traceId)static Span.BuilderspanBuilder(String serviceNameSuffix)static longstartTs(List<Span> trace)static EndpointsuffixServiceName(Endpoint endpoint, String serviceNameSuffix)
-
-
-
Field Detail
-
UTF_8
public static final Charset UTF_8
-
DAY
public static final long DAY
Notably, the cassandra implementation has day granularity
-
TODAY
public static final long TODAY
-
FRONTEND
public static final Endpoint FRONTEND
-
BACKEND
public static final Endpoint BACKEND
-
DB
public static final Endpoint DB
-
KAFKA
public static final Endpoint KAFKA
-
CLIENT_SPAN
public static final Span CLIENT_SPAN
Only for unit tests, not integration tests. Integration tests should use random trace IDs.
-
TRACE
public static final List<Span> TRACE
Only for unit tests, not integration tests. Integration tests should use random trace IDs.
-
LOTS_OF_SPANS
public static final Span[] LOTS_OF_SPANS
Zipkin trace ids are random 64bit numbers. This creates a relatively large input to avoid flaking out due to PRNG nuance.
-
-
Method Detail
-
midnightUTC
public static long midnightUTC(long epochMillis)
For bucketed data floored to the day. For example, dependency links.
-
span
public static Span span(long traceId)
-
spanBuilder
public static Span.Builder spanBuilder(String serviceNameSuffix)
-
suffixServiceName
public static Endpoint suffixServiceName(Endpoint endpoint, String serviceNameSuffix)
-
newTraceId
public static String newTraceId()
-
-