diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2015-03-05 23:39:44 +0100 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2015-03-09 23:09:08 +0100 |
commit | a4deb46e942241a8922152de4eaf5725996c6669 (patch) | |
tree | 97bbbbdc16c6f8dc934f9d1548fc8c7416becffc /kamon-core/src/test/scala/kamon/testkit/BaseKamonSpec.scala | |
parent | 0ae95da1627ed159cbd4336b3f8980a6280b5163 (diff) | |
download | Kamon-a4deb46e942241a8922152de4eaf5725996c6669.tar.gz Kamon-a4deb46e942241a8922152de4eaf5725996c6669.tar.bz2 Kamon-a4deb46e942241a8922152de4eaf5725996c6669.zip |
! all: introduced support for metric tags.
Diffstat (limited to 'kamon-core/src/test/scala/kamon/testkit/BaseKamonSpec.scala')
-rw-r--r-- | kamon-core/src/test/scala/kamon/testkit/BaseKamonSpec.scala | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/kamon-core/src/test/scala/kamon/testkit/BaseKamonSpec.scala b/kamon-core/src/test/scala/kamon/testkit/BaseKamonSpec.scala index f3d809bf..e7b18770 100644 --- a/kamon-core/src/test/scala/kamon/testkit/BaseKamonSpec.scala +++ b/kamon-core/src/test/scala/kamon/testkit/BaseKamonSpec.scala @@ -20,7 +20,7 @@ import akka.testkit.{ ImplicitSender, TestKitBase } import akka.actor.ActorSystem import com.typesafe.config.{ Config, ConfigFactory } import kamon.Kamon -import kamon.metric.{ SubscriptionsDispatcher, EntitySnapshot, MetricsImpl } +import kamon.metric.{ Entity, SubscriptionsDispatcher, EntitySnapshot, MetricsImpl } import kamon.trace.TraceContext import kamon.util.LazyActorRef import org.scalatest.{ BeforeAndAfterAll, Matchers, WordSpecLike } @@ -48,6 +48,11 @@ abstract class BaseKamonSpec(actorSystemName: String) extends TestKitBase with W recorder.collect(collectionContext) } + def takeSnapshotOf(name: String, category: String, tags: Map[String, String]): EntitySnapshot = { + val recorder = Kamon.metrics.find(Entity(name, category, tags)).get + recorder.collect(collectionContext) + } + def flushSubscriptions(): Unit = { val subscriptionsField = Kamon.metrics.getClass.getDeclaredField("_subscriptions") subscriptionsField.setAccessible(true) |