aboutsummaryrefslogtreecommitdiff
path: root/kamon-core-tests/src/test/scala/kamon/metric/MetricLookupSpec.scala
diff options
context:
space:
mode:
authorIvan Topolnjak <ivantopo@gmail.com>2017-08-15 00:33:06 +0200
committerIvan Topolnjak <ivantopo@gmail.com>2017-08-15 00:33:06 +0200
commita90d4aa75e7fdf12a85177f4e81463439bfe5bb3 (patch)
tree2b815c06862332752ff4192c4bdceb4413cf2945 /kamon-core-tests/src/test/scala/kamon/metric/MetricLookupSpec.scala
parent86c72d622ac027dc96f9a744771c0a468d46dc60 (diff)
downloadKamon-a90d4aa75e7fdf12a85177f4e81463439bfe5bb3.tar.gz
Kamon-a90d4aa75e7fdf12a85177f4e81463439bfe5bb3.tar.bz2
Kamon-a90d4aa75e7fdf12a85177f4e81463439bfe5bb3.zip
separate the build into core, testkit and core-tests projects
Diffstat (limited to 'kamon-core-tests/src/test/scala/kamon/metric/MetricLookupSpec.scala')
-rw-r--r--kamon-core-tests/src/test/scala/kamon/metric/MetricLookupSpec.scala62
1 files changed, 62 insertions, 0 deletions
diff --git a/kamon-core-tests/src/test/scala/kamon/metric/MetricLookupSpec.scala b/kamon-core-tests/src/test/scala/kamon/metric/MetricLookupSpec.scala
new file mode 100644
index 00000000..1d60a28f
--- /dev/null
+++ b/kamon-core-tests/src/test/scala/kamon/metric/MetricLookupSpec.scala
@@ -0,0 +1,62 @@
+package kamon.metric
+
+import kamon.Kamon
+import org.scalatest.{Matchers, WordSpec}
+
+class MetricLookupSpec extends WordSpec with Matchers {
+
+ "the Kamon companion object" can {
+ "lookup a metric and" should {
+ "always return the same histogram metric" in {
+ val histogramOne = Kamon.histogram("histogram-lookup")
+ val histogramTwo = Kamon.histogram("histogram-lookup")
+ histogramOne shouldBe theSameInstanceAs(histogramTwo)
+ }
+
+ "always return the same counter metric" in {
+ val counterOne = Kamon.counter("counter-lookup")
+ val counterTwo = Kamon.counter("counter-lookup")
+ counterOne shouldBe theSameInstanceAs(counterTwo)
+ }
+
+ "always return the same gauge metric" in {
+ val gaugeOne = Kamon.gauge("gauge-lookup")
+ val gaugeTwo = Kamon.gauge("gauge-lookup")
+ gaugeOne shouldBe theSameInstanceAs(gaugeTwo)
+ }
+
+ "always return the same min-max-counter metric" in {
+ val minMaxCounterOne = Kamon.minMaxCounter("min-max-counter-lookup")
+ val minMaxCounterTwo = Kamon.minMaxCounter("min-max-counter-lookup")
+ minMaxCounterOne shouldBe theSameInstanceAs(minMaxCounterTwo)
+ }
+ }
+
+ "refine a metric with tags and" should {
+ "always return the same histogram for a set of tags" in {
+ val histogramOne = Kamon.histogram("histogram-lookup").refine("tag" -> "value")
+ val histogramTwo = Kamon.histogram("histogram-lookup").refine("tag" -> "value")
+ histogramOne shouldBe theSameInstanceAs(histogramTwo)
+ }
+
+ "always return the same counter for a set of tags" in {
+ val counterOne = Kamon.counter("counter-lookup").refine("tag" -> "value")
+ val counterTwo = Kamon.counter("counter-lookup").refine("tag" -> "value")
+ counterOne shouldBe theSameInstanceAs(counterTwo)
+ }
+
+ "always return the same gauge for a set of tags" in {
+ val gaugeOne = Kamon.gauge("gauge-lookup").refine("tag" -> "value")
+ val gaugeTwo = Kamon.gauge("gauge-lookup").refine("tag" -> "value")
+ gaugeOne shouldBe theSameInstanceAs(gaugeTwo)
+ }
+
+ "always return the same min-max-counter for a set of tags" in {
+ val minMaxCounterOne = Kamon.minMaxCounter("min-max-counter-lookup").refine("tag" -> "value")
+ val minMaxCounterTwo = Kamon.minMaxCounter("min-max-counter-lookup").refine("tag" -> "value")
+ minMaxCounterOne shouldBe theSameInstanceAs(minMaxCounterTwo)
+ }
+ }
+ }
+
+}