diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2014-01-27 09:11:32 -0300 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2014-01-27 09:11:32 -0300 |
commit | 633b4058207d084724743c6b6367ac60f95ff987 (patch) | |
tree | a0ea788593b93b2657e1924e578ff274aab3eeee /kamon-core/src/main/scala/kamon/metrics | |
parent | f341a9f01aa53bb79dbbc8a2cccd652c03ae5267 (diff) | |
download | Kamon-633b4058207d084724743c6b6367ac60f95ff987.tar.gz Kamon-633b4058207d084724743c6b6367ac60f95ff987.tar.bz2 Kamon-633b4058207d084724743c6b6367ac60f95ff987.zip |
rename UOW to TraceToken and generate it by default when a Trace starts
Diffstat (limited to 'kamon-core/src/main/scala/kamon/metrics')
-rw-r--r-- | kamon-core/src/main/scala/kamon/metrics/ActorMetricsOps.scala | 8 | ||||
-rw-r--r-- | kamon-core/src/main/scala/kamon/metrics/AtomicSnapshotableHistogram.scala | 13 |
2 files changed, 5 insertions, 16 deletions
diff --git a/kamon-core/src/main/scala/kamon/metrics/ActorMetricsOps.scala b/kamon-core/src/main/scala/kamon/metrics/ActorMetricsOps.scala index dc4abde0..4a6c98f4 100644 --- a/kamon-core/src/main/scala/kamon/metrics/ActorMetricsOps.scala +++ b/kamon-core/src/main/scala/kamon/metrics/ActorMetricsOps.scala @@ -45,14 +45,6 @@ trait ActorMetricsOps { () ⇒ new HdrActorMetricsRecorder(processingTimeHdrConfig, timeInMailboxHdrConfig, mailboxSizeHdrConfig) } - import scala.concurrent.duration._ - system.scheduler.schedule(0.seconds, 10.seconds)( - actorMetrics.collect { - case (name, recorder: HdrActorMetricsRecorder) ⇒ - println(s"Actor: $name") - recorder.processingTimeHistogram.copy.getHistogramData.outputPercentileDistribution(System.out, 1000000D) - })(system.dispatcher) - def shouldTrackActor(path: String): Boolean = trackedActors.exists(glob ⇒ glob.accept(path)) && !excludedActors.exists(glob ⇒ glob.accept(path)) diff --git a/kamon-core/src/main/scala/kamon/metrics/AtomicSnapshotableHistogram.scala b/kamon-core/src/main/scala/kamon/metrics/AtomicSnapshotableHistogram.scala index 39d4ac0b..c9e47792 100644 --- a/kamon-core/src/main/scala/kamon/metrics/AtomicSnapshotableHistogram.scala +++ b/kamon-core/src/main/scala/kamon/metrics/AtomicSnapshotableHistogram.scala @@ -18,8 +18,7 @@ package org.HdrHistogram import java.util.concurrent.atomic.AtomicLongFieldUpdater import scala.annotation.tailrec -import org.HdrHistogram.AtomicSnapshotableHistogram.{Value, Snapshot} - +import org.HdrHistogram.AtomicSnapshotableHistogram.{ Value, Snapshot } /** * This implementation aims to be used for real time data collection where data snapshots are taken often over time. @@ -27,25 +26,23 @@ import org.HdrHistogram.AtomicSnapshotableHistogram.{Value, Snapshot} * leave it in a consistent state even in the case of concurrent modification while the snapshot is being taken. */ class AtomicSnapshotableHistogram(highestTrackableValue: Long, numberOfSignificantValueDigits: Int) - extends AtomicHistogram(1L, highestTrackableValue, numberOfSignificantValueDigits) { + extends AtomicHistogram(1L, highestTrackableValue, numberOfSignificantValueDigits) { import AtomicSnapshotableHistogram.totalCountUpdater - def snapshotAndReset(): Snapshot = { val entries = Vector.newBuilder[Value] val countsLength = counts.length() @tailrec def iterate(index: Int, previousValue: Long, nrOfRecordings: Long, bucketLimit: Long, increment: Long): Long = { - if(index < countsLength) { + if (index < countsLength) { val currentValue = previousValue + increment val countAtValue = counts.getAndSet(index, 0) - if(countAtValue > 0) + if (countAtValue > 0) entries += Value(currentValue, countAtValue) - - if(currentValue == bucketLimit) + if (currentValue == bucketLimit) iterate(index + 1, currentValue, nrOfRecordings + countAtValue, (bucketLimit << 1) + 1, increment << 1) else iterate(index + 1, currentValue, nrOfRecordings + countAtValue, bucketLimit, increment) |