diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2015-02-15 01:47:32 +0100 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2015-02-15 01:47:32 +0100 |
commit | 81c52c27d2b4784d561ae63b884b6e8c9e03db58 (patch) | |
tree | 1414f438c83976d60e98d27041ec3c177094881e /kamon-core/src/main/scala/kamon/trace | |
parent | a313e1e94b1f8a660e24a47f7f76a28a97dad8ff (diff) | |
download | Kamon-81c52c27d2b4784d561ae63b884b6e8c9e03db58.tar.gz Kamon-81c52c27d2b4784d561ae63b884b6e8c9e03db58.tar.bz2 Kamon-81c52c27d2b4784d561ae63b884b6e8c9e03db58.zip |
= all: stop using config.getDuration in favor of config.getFiniteDuration.
Diffstat (limited to 'kamon-core/src/main/scala/kamon/trace')
-rw-r--r-- | kamon-core/src/main/scala/kamon/trace/Incubator.scala | 12 | ||||
-rw-r--r-- | kamon-core/src/main/scala/kamon/trace/TracerExtensionSettings.scala | 4 |
2 files changed, 7 insertions, 9 deletions
diff --git a/kamon-core/src/main/scala/kamon/trace/Incubator.scala b/kamon-core/src/main/scala/kamon/trace/Incubator.scala index 3b2a3bf9..05279d95 100644 --- a/kamon-core/src/main/scala/kamon/trace/Incubator.scala +++ b/kamon-core/src/main/scala/kamon/trace/Incubator.scala @@ -16,24 +16,22 @@ package kamon.trace -import java.util.concurrent.TimeUnit - import akka.actor.{ ActorLogging, Props, Actor, ActorRef } import kamon.trace.Incubator.{ CheckForCompletedTraces, IncubatingTrace } import kamon.util.{ NanoInterval, RelativeNanoTimestamp } import scala.annotation.tailrec import scala.collection.immutable.Queue -import scala.concurrent.duration._ +import kamon.util.ConfigTools.Syntax class Incubator(subscriptions: ActorRef) extends Actor with ActorLogging { import context.dispatcher val config = context.system.settings.config.getConfig("kamon.trace.incubator") - val minIncubationTime = new NanoInterval(config.getDuration("min-incubation-time", TimeUnit.NANOSECONDS)) - val maxIncubationTime = new NanoInterval(config.getDuration("max-incubation-time", TimeUnit.NANOSECONDS)) - val checkInterval = config.getDuration("check-interval", TimeUnit.MILLISECONDS) + val minIncubationTime = new NanoInterval(config.getFiniteDuration("min-incubation-time").toNanos) + val maxIncubationTime = new NanoInterval(config.getFiniteDuration("max-incubation-time").toNanos) + val checkInterval = config.getFiniteDuration("check-interval") - val checkSchedule = context.system.scheduler.schedule(checkInterval.millis, checkInterval.millis, self, CheckForCompletedTraces) + val checkSchedule = context.system.scheduler.schedule(checkInterval, checkInterval, self, CheckForCompletedTraces) var waitingForMinimumIncubation = Queue.empty[IncubatingTrace] var waitingForIncubationFinish = List.empty[IncubatingTrace] diff --git a/kamon-core/src/main/scala/kamon/trace/TracerExtensionSettings.scala b/kamon-core/src/main/scala/kamon/trace/TracerExtensionSettings.scala index 7510ab7f..6167a007 100644 --- a/kamon-core/src/main/scala/kamon/trace/TracerExtensionSettings.scala +++ b/kamon-core/src/main/scala/kamon/trace/TracerExtensionSettings.scala @@ -17,7 +17,7 @@ package kamon.trace import java.util.concurrent.TimeUnit - +import kamon.util.ConfigTools.Syntax import com.typesafe.config.Config case class TraceSettings(levelOfDetail: LevelOfDetail, sampler: Sampler) @@ -38,7 +38,7 @@ object TraceSettings { case "all" ⇒ SampleAll case "random" ⇒ new RandomSampler(tracerConfig.getInt("random-sampler.chance")) case "ordered" ⇒ new OrderedSampler(tracerConfig.getInt("ordered-sampler.interval")) - case "threshold" ⇒ new ThresholdSampler(tracerConfig.getDuration("threshold-sampler.minimum-elapsed-time", TimeUnit.NANOSECONDS)) + case "threshold" ⇒ new ThresholdSampler(tracerConfig.getFiniteDuration("threshold-sampler.minimum-elapsed-time").toNanos) } TraceSettings(detailLevel, sampler) |