diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2017-08-15 00:06:26 +0200 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2017-08-15 00:06:26 +0200 |
commit | 6721d325d018756296213ac8f9129bc304a21afb (patch) | |
tree | e08a5ce92802f521be228beae0ddb4ef258d0066 /kamon-core/src/test/scala/kamon/testkit/SpanBuilding.scala | |
parent | ac3b72e27765ceec4cc3958b0fa7eaba0299f017 (diff) | |
parent | a949c875684d78818224cd2ca7aaf79aa7878724 (diff) | |
download | Kamon-6721d325d018756296213ac8f9129bc304a21afb.tar.gz Kamon-6721d325d018756296213ac8f9129bc304a21afb.tar.bz2 Kamon-6721d325d018756296213ac8f9129bc304a21afb.zip |
Merge remote-tracking branch 'ivantopo/wip/moving-ot-support-to-a-separeate-project' into kamon-1.0-develop
Diffstat (limited to 'kamon-core/src/test/scala/kamon/testkit/SpanBuilding.scala')
-rw-r--r-- | kamon-core/src/test/scala/kamon/testkit/SpanBuilding.scala | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/kamon-core/src/test/scala/kamon/testkit/SpanBuilding.scala b/kamon-core/src/test/scala/kamon/testkit/SpanBuilding.scala new file mode 100644 index 00000000..7a216ecc --- /dev/null +++ b/kamon-core/src/test/scala/kamon/testkit/SpanBuilding.scala @@ -0,0 +1,16 @@ +package kamon.testkit + +import kamon.trace.SpanContext.SamplingDecision +import kamon.trace.{IdentityProvider, SpanContext} + +trait SpanBuilding { + private val identityProvider = IdentityProvider.Default() + + def createSpanContext(samplingDecision: SamplingDecision = SamplingDecision.Sample): SpanContext = + SpanContext( + traceID = identityProvider.traceIdGenerator().generate(), + spanID = identityProvider.spanIdGenerator().generate(), + parentID = identityProvider.spanIdGenerator().generate(), + samplingDecision = samplingDecision + ) +} |