diff options
Diffstat (limited to 'kamon-core/src')
-rw-r--r-- | kamon-core/src/main/scala/kamon/metrics/Metrics.scala | 4 | ||||
-rw-r--r-- | kamon-core/src/main/scala/kamon/trace/TraceRecorder.scala | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/kamon-core/src/main/scala/kamon/metrics/Metrics.scala b/kamon-core/src/main/scala/kamon/metrics/Metrics.scala index ee32dbe8..81475d52 100644 --- a/kamon-core/src/main/scala/kamon/metrics/Metrics.scala +++ b/kamon-core/src/main/scala/kamon/metrics/Metrics.scala @@ -102,8 +102,8 @@ object MetricSnapshot { case class DefaultMetricSnapshot(numberOfMeasurements: Long, measurementLevels: Vector[MetricSnapshot.Measurement]) extends MetricSnapshot -object MetricGroupIdentity { - +object DefaultMetricSnapshot { + val empty = DefaultMetricSnapshot(0, Vector.empty) } trait MetricGroupFactory { diff --git a/kamon-core/src/main/scala/kamon/trace/TraceRecorder.scala b/kamon-core/src/main/scala/kamon/trace/TraceRecorder.scala index 3e3bb19f..0e264cd2 100644 --- a/kamon-core/src/main/scala/kamon/trace/TraceRecorder.scala +++ b/kamon-core/src/main/scala/kamon/trace/TraceRecorder.scala @@ -54,6 +54,8 @@ object TraceRecorder { def startSegment(identity: SegmentIdentity, metadata: Map[String, String]): Option[SegmentCompletionHandle] = currentContext.map(_.startSegment(identity, metadata)) + def rename(name: String): Unit = currentContext.map(_.rename(name)) + def withNewTraceContext[T](name: String, token: Option[String] = None, metadata: Map[String, String] = Map.empty)(thunk: ⇒ T)(implicit system: ActorSystem): T = withTraceContext(Some(newTraceContext(name, token, metadata, system)))(thunk) |