aboutsummaryrefslogtreecommitdiff
path: root/kamon-core/src/test
diff options
context:
space:
mode:
authorDiego <diegolparra@gmail.com>2016-04-01 01:52:41 -0300
committerDiego <diegolparra@gmail.com>2016-04-22 00:57:52 -0300
commit9bdb042fc802fbed07ac428dfe10405da638e86e (patch)
treeb563211833e6a946cba6592085f948b60b9ec160 /kamon-core/src/test
parenta96d9e0ac5fafd29e2bfc2e4ae10a673690f1e42 (diff)
downloadKamon-9bdb042fc802fbed07ac428dfe10405da638e86e.tar.gz
Kamon-9bdb042fc802fbed07ac428dfe10405da638e86e.tar.bz2
Kamon-9bdb042fc802fbed07ac428dfe10405da638e86e.zip
Add tags for traces and closes #327
Diffstat (limited to 'kamon-core/src/test')
-rw-r--r--kamon-core/src/test/scala/kamon/testkit/BaseKamonSpec.scala7
-rw-r--r--kamon-core/src/test/scala/kamon/trace/SimpleTraceSpec.scala4
-rw-r--r--kamon-core/src/test/scala/kamon/trace/TraceContextManipulationSpec.scala1
3 files changed, 7 insertions, 5 deletions
diff --git a/kamon-core/src/test/scala/kamon/testkit/BaseKamonSpec.scala b/kamon-core/src/test/scala/kamon/testkit/BaseKamonSpec.scala
index f23d974c..497cb77d 100644
--- a/kamon-core/src/test/scala/kamon/testkit/BaseKamonSpec.scala
+++ b/kamon-core/src/test/scala/kamon/testkit/BaseKamonSpec.scala
@@ -20,8 +20,8 @@ import akka.testkit.{ ImplicitSender, TestKitBase }
import akka.actor.ActorSystem
import com.typesafe.config.{ Config, ConfigFactory }
import kamon.Kamon
-import kamon.metric.{ Entity, SubscriptionsDispatcher, EntitySnapshot }
-import kamon.trace.TraceContext
+import kamon.metric.{ Entity, EntitySnapshot, SubscriptionsDispatcher }
+import kamon.trace.{ TraceContext, Tracer }
import kamon.util.LazyActorRef
import org.scalatest.{ BeforeAndAfterAll, Matchers, WordSpecLike }
@@ -41,6 +41,9 @@ abstract class BaseKamonSpec(actorSystemName: String) extends TestKitBase with W
def newContext(name: String, token: String): TraceContext =
Kamon.tracer.newContext(name, Option(token))
+ def newContext(name: String, token: String, tags: Map[String, String]): TraceContext =
+ Kamon.tracer.newContext(name, Option(token), tags)
+
def takeSnapshotOf(name: String, category: String): EntitySnapshot = {
val recorder = Kamon.metrics.find(name, category).get
recorder.collect(collectionContext)
diff --git a/kamon-core/src/test/scala/kamon/trace/SimpleTraceSpec.scala b/kamon-core/src/test/scala/kamon/trace/SimpleTraceSpec.scala
index d6886d4c..95deeef9 100644
--- a/kamon-core/src/test/scala/kamon/trace/SimpleTraceSpec.scala
+++ b/kamon-core/src/test/scala/kamon/trace/SimpleTraceSpec.scala
@@ -1,6 +1,6 @@
/*
* =========================================================================================
- * Copyright © 2013-2014 the kamon project <http://kamon.io/>
+ * Copyright © 2013-2016 the kamon project <http://kamon.io/>
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of the License at
@@ -16,9 +16,9 @@
package kamon.trace
-import com.typesafe.config.ConfigFactory
import kamon.Kamon
import kamon.testkit.BaseKamonSpec
+
import scala.concurrent.duration._
class SimpleTraceSpec extends BaseKamonSpec("simple-trace-spec") {
diff --git a/kamon-core/src/test/scala/kamon/trace/TraceContextManipulationSpec.scala b/kamon-core/src/test/scala/kamon/trace/TraceContextManipulationSpec.scala
index ecef9271..6a454149 100644
--- a/kamon-core/src/test/scala/kamon/trace/TraceContextManipulationSpec.scala
+++ b/kamon-core/src/test/scala/kamon/trace/TraceContextManipulationSpec.scala
@@ -16,7 +16,6 @@
package kamon.trace
-import com.typesafe.config.ConfigFactory
import kamon.testkit.BaseKamonSpec
class TraceContextManipulationSpec extends BaseKamonSpec("trace-metrics-spec") {