aboutsummaryrefslogtreecommitdiff
path: root/kamon-core
diff options
context:
space:
mode:
authorIvan Topolnjak <ivantopo@gmail.com>2014-05-18 22:15:27 -0300
committerIvan Topolnjak <ivantopo@gmail.com>2014-05-18 22:15:27 -0300
commit2f0bf70826cfde49e980d362179717314290b6f1 (patch)
tree90a745be5562add855f5506bb9a96fed3e31a75e /kamon-core
parentb18d05149881e9eb141f9f4878916f37c5b52247 (diff)
downloadKamon-2f0bf70826cfde49e980d362179717314290b6f1.tar.gz
Kamon-2f0bf70826cfde49e980d362179717314290b6f1.tar.bz2
Kamon-2f0bf70826cfde49e980d362179717314290b6f1.zip
+ core: allow dispatcher configuration to core components
Diffstat (limited to 'kamon-core')
-rw-r--r--kamon-core/src/main/resources/reference.conf18
-rw-r--r--kamon-core/src/main/scala/kamon/metrics/MetricsExtension.scala4
-rw-r--r--kamon-core/src/main/scala/kamon/util/Contexts.scala24
3 files changed, 12 insertions, 34 deletions
diff --git a/kamon-core/src/main/resources/reference.conf b/kamon-core/src/main/resources/reference.conf
index b1e5309d..9abfd26a 100644
--- a/kamon-core/src/main/resources/reference.conf
+++ b/kamon-core/src/main/resources/reference.conf
@@ -3,22 +3,26 @@
# ================================== #
kamon {
+
+ # Default dispatcher for all Kamon components, unless a more specific one is configured.
+ default-dispatcher = "akka.actor.default-dispatcher"
+
metrics {
- # Time interval at which Kamon will collect all metrics and send them to all subscribed actors.
+ # Time interval for collecting all metrics and send the snapshots to all subscribed actors.
tick-interval = 1 second
- # Time interval at which Kamon will record values for all registered gauges.
+ # Time interval for recording values on all registered gauges.
gauge-recording-interval = 100 milliseconds
+
dispatchers {
- # All Gauges record values periodically according to the `kamon.metrics.gauge-recording-interval` setting.
- # This dispatcher is the one to be used to execute the recording code.
- gauge-recordings = "akka.actor.default-dispatcher"
+ # Dispatcher for periodical gauge value recordings.
+ gauge-recordings = ${kamon.default-dispatcher}
- # Dispatcher for the actor managing all subscriptions and metrics collection.
- metric-subscriptions = "akka.actor.default-dispatcher"
+ # Dispatcher for subscriptions and metrics collection actors.
+ metric-subscriptions = ${kamon.default-dispatcher}
}
diff --git a/kamon-core/src/main/scala/kamon/metrics/MetricsExtension.scala b/kamon-core/src/main/scala/kamon/metrics/MetricsExtension.scala
index 78a82d96..c60babb2 100644
--- a/kamon-core/src/main/scala/kamon/metrics/MetricsExtension.scala
+++ b/kamon-core/src/main/scala/kamon/metrics/MetricsExtension.scala
@@ -19,7 +19,7 @@ package kamon.metrics
import scala.collection.concurrent.TrieMap
import akka.actor._
import com.typesafe.config.Config
-import kamon.util.{ Contexts, GlobPathFilter }
+import kamon.util.GlobPathFilter
import kamon.Kamon
import akka.actor
import kamon.metrics.Metrics.MetricGroupFilter
@@ -92,8 +92,6 @@ class MetricsExtension(system: ExtendedActorSystem) extends Kamon.Extension {
allFilters.toMap
}
-
- val defaultDispatcher = Contexts.lookupExecutionContext(Contexts.kamonDefaultDispatcher)(system)
}
object Metrics extends ExtensionId[MetricsExtension] with ExtensionIdProvider {
diff --git a/kamon-core/src/main/scala/kamon/util/Contexts.scala b/kamon-core/src/main/scala/kamon/util/Contexts.scala
deleted file mode 100644
index be0d367e..00000000
--- a/kamon-core/src/main/scala/kamon/util/Contexts.scala
+++ /dev/null
@@ -1,24 +0,0 @@
-package kamon.util
-
-import akka.actor.ActorSystem
-
-/*
- * =========================================================================================
- * Copyright © 2013-2014 the kamon project <http://kamon.io/>
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the
- * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific language governing permissions
- * and limitations under the License.
- * =========================================================================================
- */
-object Contexts {
- val kamonDefaultDispatcher = "kamon.default-dispatcher"
-
- def lookupExecutionContext(id: String)(implicit system: ActorSystem) = system.dispatchers.lookup(id)
-}