aboutsummaryrefslogtreecommitdiff
path: root/kamon-core-tests
diff options
context:
space:
mode:
authorIvan Topolnjak <ivantopo@gmail.com>2017-11-17 14:46:30 +0100
committerIvan Topolnjak <ivantopo@gmail.com>2017-11-17 14:46:30 +0100
commit583552adbbf796d61514d1a86d2513b667bf3e94 (patch)
treea475d5322ab6d7a189d2c351eb6c59ecdbe4dc5d /kamon-core-tests
parent018cd65f011b3aef4251a923a66f4142434e52d7 (diff)
downloadKamon-583552adbbf796d61514d1a86d2513b667bf3e94.tar.gz
Kamon-583552adbbf796d61514d1a86d2513b667bf3e94.tar.bz2
Kamon-583552adbbf796d61514d1a86d2513b667bf3e94.zip
add marks API for Spans
Diffstat (limited to 'kamon-core-tests')
-rw-r--r--kamon-core-tests/src/test/scala/kamon/trace/LocalSpanSpec.scala20
1 files changed, 14 insertions, 6 deletions
diff --git a/kamon-core-tests/src/test/scala/kamon/trace/LocalSpanSpec.scala b/kamon-core-tests/src/test/scala/kamon/trace/LocalSpanSpec.scala
index 05c1c53a..5d636d16 100644
--- a/kamon-core-tests/src/test/scala/kamon/trace/LocalSpanSpec.scala
+++ b/kamon-core-tests/src/test/scala/kamon/trace/LocalSpanSpec.scala
@@ -18,7 +18,7 @@ package kamon.trace
import kamon.testkit.{MetricInspection, Reconfigure, TestSpanReporter}
import kamon.util.Registration
import kamon.Kamon
-import kamon.trace.Span.{Annotation, TagValue}
+import kamon.trace.Span.TagValue
import org.scalatest.concurrent.Eventually
import org.scalatest.{BeforeAndAfterAll, Matchers, OptionValues, WordSpec}
import org.scalatest.time.SpanSugar._
@@ -44,7 +44,7 @@ class LocalSpanSpec extends WordSpec with Matchers with BeforeAndAfterAll with E
}
}
- "pass all the tags to the FinishedSpan instance when started and finished" in {
+ "pass all the tags and marks to the FinishedSpan instance when started and finished" in {
Kamon.buildSpan("full-span")
.withTag("builder-string-tag", "value")
.withTag("builder-boolean-tag-true", true)
@@ -52,10 +52,12 @@ class LocalSpanSpec extends WordSpec with Matchers with BeforeAndAfterAll with E
.withTag("builder-number-tag", 42)
.withStartTimestamp(100)
.start()
- .addTag("span-string-tag", "value")
- .addTag("span-boolean-tag-true", true)
- .addTag("span-boolean-tag-false", false)
- .addTag("span-number-tag", 42)
+ .tag("span-string-tag", "value")
+ .tag("span-boolean-tag-true", true)
+ .tag("span-boolean-tag-false", false)
+ .tag("span-number-tag", 42)
+ .mark("my-mark")
+ .mark(100, "my-custom-timetamp-mark")
.setOperationName("fully-populated-span")
.finish(200)
@@ -74,6 +76,12 @@ class LocalSpanSpec extends WordSpec with Matchers with BeforeAndAfterAll with E
"span-boolean-tag-false" -> TagValue.False,
"span-number-tag" -> TagValue.Number(42)
)
+ finishedSpan.marks.map(_.key) should contain allOf(
+ "my-mark",
+ "my-custom-timetamp-mark"
+ )
+ finishedSpan.marks.find(_.key == "my-custom-timetamp-mark").value.timestampMicros should be(100)
+
}
}
}