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 | 959ce3573253ec4ac5b837d8a9c9e70f1f80bd6b (patch) | |
tree | 27c1fe8f22429fe3820f988ab17caaf8e4a6fa3a /kamon-spray/src/test/scala/kamon/spray | |
parent | 69ea63923e0d3697f8ca4c7eb9cb808821832aa2 (diff) | |
download | Kamon-959ce3573253ec4ac5b837d8a9c9e70f1f80bd6b.tar.gz Kamon-959ce3573253ec4ac5b837d8a9c9e70f1f80bd6b.tar.bz2 Kamon-959ce3573253ec4ac5b837d8a9c9e70f1f80bd6b.zip |
! all: introduced support for metric tags.
Diffstat (limited to 'kamon-spray/src/test/scala/kamon/spray')
-rw-r--r-- | kamon-spray/src/test/scala/kamon/spray/ClientRequestInstrumentationSpec.scala | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/kamon-spray/src/test/scala/kamon/spray/ClientRequestInstrumentationSpec.scala b/kamon-spray/src/test/scala/kamon/spray/ClientRequestInstrumentationSpec.scala index 67e6725f..4b99022e 100644 --- a/kamon-spray/src/test/scala/kamon/spray/ClientRequestInstrumentationSpec.scala +++ b/kamon-spray/src/test/scala/kamon/spray/ClientRequestInstrumentationSpec.scala @@ -34,8 +34,6 @@ import scala.concurrent.duration._ class ClientRequestInstrumentationSpec extends BaseKamonSpec("client-request-instrumentation-spec") with ScalaFutures with RequestBuilding with TestServer { - import TraceMetricsSpec.SegmentSyntax - override lazy val config = ConfigFactory.parseString( """ @@ -130,8 +128,14 @@ class ClientRequestInstrumentationSpec extends BaseKamonSpec("client-request-ins val traceMetricsSnapshot = takeSnapshotOf("assign-name-to-segment-with-request-level-api", "trace") traceMetricsSnapshot.histogram("elapsed-time").get.numberOfMeasurements should be(1) - traceMetricsSnapshot.segment("request-level /request-level-api-segment", SegmentCategory.HttpClient, Spray.SegmentLibraryName) - .numberOfMeasurements should be(1) + + val segmentMetricsSnapshot = takeSnapshotOf("request-level /request-level-api-segment", "trace-segment", + tags = Map( + "trace" -> "assign-name-to-segment-with-request-level-api", + "category" -> SegmentCategory.HttpClient, + "library" -> Spray.SegmentLibraryName)) + + segmentMetricsSnapshot.histogram("elapsed-time").get.numberOfMeasurements should be(1) } "rename a request level api segment once it reaches the relevant host connector" in { @@ -161,8 +165,14 @@ class ClientRequestInstrumentationSpec extends BaseKamonSpec("client-request-ins val traceMetricsSnapshot = takeSnapshotOf("rename-segment-with-request-level-api", "trace") traceMetricsSnapshot.histogram("elapsed-time").get.numberOfMeasurements should be(1) - traceMetricsSnapshot.segment("host-level /request-level-api-segment", SegmentCategory.HttpClient, Spray.SegmentLibraryName) - .numberOfMeasurements should be(1) + + val segmentMetricsSnapshot = takeSnapshotOf("host-level /request-level-api-segment", "trace-segment", + tags = Map( + "trace" -> "rename-segment-with-request-level-api", + "category" -> SegmentCategory.HttpClient, + "library" -> Spray.SegmentLibraryName)) + + segmentMetricsSnapshot.histogram("elapsed-time").get.numberOfMeasurements should be(1) } } @@ -249,8 +259,14 @@ class ClientRequestInstrumentationSpec extends BaseKamonSpec("client-request-ins val traceMetricsSnapshot = takeSnapshotOf("create-segment-with-host-level-api", "trace") traceMetricsSnapshot.histogram("elapsed-time").get.numberOfMeasurements should be(1) - traceMetricsSnapshot.segment("host-level /host-level-api-segment", SegmentCategory.HttpClient, Spray.SegmentLibraryName) - .numberOfMeasurements should be(1) + + val segmentMetricsSnapshot = takeSnapshotOf("host-level /host-level-api-segment", "trace-segment", + tags = Map( + "trace" -> "create-segment-with-host-level-api", + "category" -> SegmentCategory.HttpClient, + "library" -> Spray.SegmentLibraryName)) + + segmentMetricsSnapshot.histogram("elapsed-time").get.numberOfMeasurements should be(1) } } } |