diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2015-02-15 10:46:36 +0100 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2015-02-15 10:46:36 +0100 |
commit | 8a532fc8c95a5700721248b6b4f558d9a1dcebcb (patch) | |
tree | 8f7f299e717ec6044b2eaa1f0922b0cbae02fd90 /kamon-core/src/main | |
parent | 0688c1a84caba17a600c498b158013f9867e4093 (diff) | |
download | Kamon-8a532fc8c95a5700721248b6b4f558d9a1dcebcb.tar.gz Kamon-8a532fc8c95a5700721248b6b4f558d9a1dcebcb.tar.bz2 Kamon-8a532fc8c95a5700721248b6b4f558d9a1dcebcb.zip |
! core: drop the Extension postfix on all core components.
Diffstat (limited to 'kamon-core/src/main')
-rw-r--r-- | kamon-core/src/main/scala/kamon/Kamon.scala | 20 | ||||
-rw-r--r-- | kamon-core/src/main/scala/kamon/metric/Metrics.scala (renamed from kamon-core/src/main/scala/kamon/metric/MetricsExtension.scala) | 12 | ||||
-rw-r--r-- | kamon-core/src/main/scala/kamon/metric/MetricsSettings.scala (renamed from kamon-core/src/main/scala/kamon/metric/MetricsExtensionSettings.scala) | 9 | ||||
-rw-r--r-- | kamon-core/src/main/scala/kamon/metric/SimpleMetrics.scala | 10 | ||||
-rw-r--r-- | kamon-core/src/main/scala/kamon/metric/SubscriptionsDispatcher.scala | 4 | ||||
-rw-r--r-- | kamon-core/src/main/scala/kamon/trace/MetricsOnlyContext.scala | 4 | ||||
-rw-r--r-- | kamon-core/src/main/scala/kamon/trace/Tracer.scala (renamed from kamon-core/src/main/scala/kamon/trace/TracerExtension.scala) | 12 | ||||
-rw-r--r-- | kamon-core/src/main/scala/kamon/trace/TracingContext.scala | 6 |
8 files changed, 38 insertions, 39 deletions
diff --git a/kamon-core/src/main/scala/kamon/Kamon.scala b/kamon-core/src/main/scala/kamon/Kamon.scala index cf492125..a2a24f49 100644 --- a/kamon-core/src/main/scala/kamon/Kamon.scala +++ b/kamon-core/src/main/scala/kamon/Kamon.scala @@ -18,15 +18,15 @@ import _root_.akka.actor import _root_.akka.actor._ import com.typesafe.config.{ ConfigFactory, Config } import kamon.metric._ -import kamon.trace.{ TracerExtensionImpl, TracerExtension } +import kamon.trace.{ TracerImpl, Tracer } object Kamon { trait Extension extends actor.Extension private case class KamonCoreComponents( - metrics: MetricsExtension, - tracer: TracerExtension, - simpleMetrics: SimpleMetricsExtension) + metrics: Metrics, + tracer: Tracer, + simpleMetrics: SimpleMetrics) @volatile private var _system: ActorSystem = _ @volatile private var _coreComponents: Option[KamonCoreComponents] = None @@ -42,9 +42,9 @@ object Kamon { } if (_coreComponents.isEmpty) { - val metrics = MetricsExtensionImpl(config) - val simpleMetrics = SimpleMetricsExtensionImpl(metrics) - val tracer = TracerExtensionImpl(metrics, config) + val metrics = MetricsImpl(config) + val simpleMetrics = SimpleMetricsImpl(metrics) + val tracer = TracerImpl(metrics, config) _coreComponents = Some(KamonCoreComponents(metrics, tracer, simpleMetrics)) _system = ActorSystem("kamon", resolveInternalConfig) @@ -64,13 +64,13 @@ object Kamon { _system = null } - def metrics: MetricsExtension = + def metrics: Metrics = ifStarted(_.metrics) - def tracer: TracerExtension = + def tracer: Tracer = ifStarted(_.tracer) - def simpleMetrics: SimpleMetricsExtension = + def simpleMetrics: SimpleMetrics = ifStarted(_.simpleMetrics) def apply[T <: Kamon.Extension](key: ExtensionId[T]): T = diff --git a/kamon-core/src/main/scala/kamon/metric/MetricsExtension.scala b/kamon-core/src/main/scala/kamon/metric/Metrics.scala index 87911352..d79b1de3 100644 --- a/kamon-core/src/main/scala/kamon/metric/MetricsExtension.scala +++ b/kamon-core/src/main/scala/kamon/metric/Metrics.scala @@ -26,8 +26,8 @@ import kamon.util.{ LazyActorRef, TriemapAtomicGetOrElseUpdate } case class EntityRegistration[T <: EntityRecorder](entity: Entity, recorder: T) -trait MetricsExtension { - def settings: MetricsExtensionSettings +trait Metrics { + def settings: MetricsSettings def shouldTrack(entity: Entity): Boolean def shouldTrack(entityName: String, category: String): Boolean = shouldTrack(Entity(entityName, category)) @@ -55,11 +55,11 @@ trait MetricsExtension { def instrumentFactory(category: String): InstrumentFactory } -private[kamon] class MetricsExtensionImpl(config: Config) extends MetricsExtension { +private[kamon] class MetricsImpl(config: Config) extends Metrics { private val _trackedEntities = TrieMap.empty[Entity, EntityRecorder] private val _subscriptions = new LazyActorRef - val settings = MetricsExtensionSettings(config) + val settings = MetricsSettings(config) def shouldTrack(entity: Entity): Boolean = settings.entityFilters.get(entity.category).map { @@ -133,9 +133,9 @@ private[kamon] class MetricsExtensionImpl(config: Config) extends MetricsExtensi } } -private[kamon] object MetricsExtensionImpl { +private[kamon] object MetricsImpl { def apply(config: Config) = - new MetricsExtensionImpl(config) + new MetricsImpl(config) } diff --git a/kamon-core/src/main/scala/kamon/metric/MetricsExtensionSettings.scala b/kamon-core/src/main/scala/kamon/metric/MetricsSettings.scala index 9881ed00..a472a89b 100644 --- a/kamon-core/src/main/scala/kamon/metric/MetricsExtensionSettings.scala +++ b/kamon-core/src/main/scala/kamon/metric/MetricsSettings.scala @@ -25,7 +25,7 @@ import scala.concurrent.duration.FiniteDuration /** * Configuration settings for the Metrics extension, as read from the `kamon.metric` configuration key. */ -case class MetricsExtensionSettings( +case class MetricsSettings( tickInterval: FiniteDuration, defaultCollectionContextBufferSize: Int, trackUnmatchedEntities: Boolean, @@ -48,11 +48,10 @@ case class EntityFilter(includes: List[GlobPathFilter], excludes: List[GlobPathF includes.exists(_.accept(name)) && !excludes.exists(_.accept(name)) } -object MetricsExtensionSettings { +object MetricsSettings { import kamon.util.ConfigTools.Syntax - import scala.concurrent.duration._ - def apply(config: Config): MetricsExtensionSettings = { + def apply(config: Config): MetricsSettings = { val metricConfig = config.getConfig("kamon.metric") val tickInterval = metricConfig.getFiniteDuration("tick-interval") @@ -65,7 +64,7 @@ object MetricsExtensionSettings { val instrumentFactories = loadInstrumentFactories(metricConfig.getConfig("instrument-settings"), defaultInstrumentSettings, refreshScheduler) val defaultInstrumentFactory = new InstrumentFactory(Map.empty, defaultInstrumentSettings, refreshScheduler) - MetricsExtensionSettings(tickInterval, collectBufferSize, trackUnmatchedEntities, entityFilters, instrumentFactories, + MetricsSettings(tickInterval, collectBufferSize, trackUnmatchedEntities, entityFilters, instrumentFactories, defaultInstrumentFactory, refreshScheduler) } diff --git a/kamon-core/src/main/scala/kamon/metric/SimpleMetrics.scala b/kamon-core/src/main/scala/kamon/metric/SimpleMetrics.scala index b8dc54df..6324c320 100644 --- a/kamon-core/src/main/scala/kamon/metric/SimpleMetrics.scala +++ b/kamon-core/src/main/scala/kamon/metric/SimpleMetrics.scala @@ -22,7 +22,7 @@ import kamon.metric.instrument._ import scala.concurrent.duration.FiniteDuration -trait SimpleMetricsExtension { +trait SimpleMetrics { def histogram(name: String): Histogram def histogram(name: String, dynamicRange: DynamicRange): Histogram def histogram(name: String, unitOfMeasurement: UnitOfMeasurement): Histogram @@ -69,7 +69,7 @@ trait SimpleMetricsExtension { } -private[kamon] class SimpleMetricsExtensionImpl(instrumentFactory: InstrumentFactory) extends GenericEntityRecorder(instrumentFactory) with SimpleMetricsExtension { +private[kamon] class SimpleMetricsImpl(instrumentFactory: InstrumentFactory) extends GenericEntityRecorder(instrumentFactory) with SimpleMetrics { override def histogram(name: String): Histogram = super.histogram(name) @@ -191,12 +191,12 @@ private[kamon] class SimpleMetricsExtensionImpl(instrumentFactory: InstrumentFac super.removeCounter(key) } -private[kamon] object SimpleMetricsExtensionImpl { +private[kamon] object SimpleMetricsImpl { val SimpleMetricsEntity = Entity("simple-metric", "simple-metric") - def apply(metricsExtension: MetricsExtension): SimpleMetricsExtensionImpl = { + def apply(metricsExtension: Metrics): SimpleMetricsImpl = { val instrumentFactory = metricsExtension.instrumentFactory(SimpleMetricsEntity.category) - val simpleMetricsExtension = new SimpleMetricsExtensionImpl(instrumentFactory) + val simpleMetricsExtension = new SimpleMetricsImpl(instrumentFactory) metricsExtension.register(SimpleMetricsEntity, simpleMetricsExtension).recorder } diff --git a/kamon-core/src/main/scala/kamon/metric/SubscriptionsDispatcher.scala b/kamon-core/src/main/scala/kamon/metric/SubscriptionsDispatcher.scala index 68b545a5..3b6be70b 100644 --- a/kamon-core/src/main/scala/kamon/metric/SubscriptionsDispatcher.scala +++ b/kamon-core/src/main/scala/kamon/metric/SubscriptionsDispatcher.scala @@ -24,7 +24,7 @@ import scala.concurrent.duration.FiniteDuration /** * Manages subscriptions to metrics and dispatch snapshots on every tick to all subscribers. */ -private[kamon] class SubscriptionsDispatcher(interval: FiniteDuration, metricsExtension: MetricsExtensionImpl) extends Actor { +private[kamon] class SubscriptionsDispatcher(interval: FiniteDuration, metricsExtension: MetricsImpl) extends Actor { var lastTick = MilliTimestamp.now var oneShotSubscriptions = Map.empty[ActorRef, SubscriptionFilter] var permanentSubscriptions = Map.empty[ActorRef, SubscriptionFilter] @@ -81,7 +81,7 @@ private[kamon] class SubscriptionsDispatcher(interval: FiniteDuration, metricsEx } object SubscriptionsDispatcher { - def props(interval: FiniteDuration, metricsExtension: MetricsExtensionImpl): Props = + def props(interval: FiniteDuration, metricsExtension: MetricsImpl): Props = Props(new SubscriptionsDispatcher(interval, metricsExtension)) case object Tick diff --git a/kamon-core/src/main/scala/kamon/trace/MetricsOnlyContext.scala b/kamon-core/src/main/scala/kamon/trace/MetricsOnlyContext.scala index 5f7fdff5..eb4bad6f 100644 --- a/kamon-core/src/main/scala/kamon/trace/MetricsOnlyContext.scala +++ b/kamon-core/src/main/scala/kamon/trace/MetricsOnlyContext.scala @@ -19,13 +19,13 @@ package kamon.trace import java.util.concurrent.ConcurrentLinkedQueue import akka.event.LoggingAdapter -import kamon.metric.{ MetricsExtension, TraceMetrics } +import kamon.metric.{ Metrics, TraceMetrics } import kamon.util.{ NanoInterval, RelativeNanoTimestamp } import scala.annotation.tailrec private[kamon] class MetricsOnlyContext(traceName: String, val token: String, izOpen: Boolean, val levelOfDetail: LevelOfDetail, - val startTimestamp: RelativeNanoTimestamp, log: LoggingAdapter, metricsExtension: MetricsExtension) + val startTimestamp: RelativeNanoTimestamp, log: LoggingAdapter, metricsExtension: Metrics) extends TraceContext { @volatile private var _name = traceName diff --git a/kamon-core/src/main/scala/kamon/trace/TracerExtension.scala b/kamon-core/src/main/scala/kamon/trace/Tracer.scala index be565154..49ab518f 100644 --- a/kamon-core/src/main/scala/kamon/trace/TracerExtension.scala +++ b/kamon-core/src/main/scala/kamon/trace/Tracer.scala @@ -21,12 +21,12 @@ import java.util.concurrent.atomic.AtomicLong import akka.actor._ import com.typesafe.config.Config -import kamon.metric.MetricsExtension +import kamon.metric.Metrics import kamon.util._ import scala.util.Try -trait TracerExtension { +trait Tracer { def newContext(name: String): TraceContext def newContext(name: String, token: String): TraceContext def newContext(name: String, token: String, timestamp: RelativeNanoTimestamp, isOpen: Boolean, isLocal: Boolean): TraceContext @@ -35,7 +35,7 @@ trait TracerExtension { def unsubscribe(subscriber: ActorRef): Unit } -private[kamon] class TracerExtensionImpl(metricsExtension: MetricsExtension, config: Config) extends TracerExtension { +private[kamon] class TracerImpl(metricsExtension: Metrics, config: Config) extends Tracer { private val _settings = TraceSettings(config) private val _hostnamePrefix = Try(InetAddress.getLocalHost.getHostName).getOrElse("unknown-localhost") private val _tokenCounter = new AtomicLong @@ -100,10 +100,10 @@ private[kamon] class TracerExtensionImpl(metricsExtension: MetricsExtension, con } } -private[kamon] object TracerExtensionImpl { +private[kamon] object TracerImpl { - def apply(metricsExtension: MetricsExtension, config: Config) = - new TracerExtensionImpl(metricsExtension, config) + def apply(metricsExtension: Metrics, config: Config) = + new TracerImpl(metricsExtension, config) } case class TraceInfo(name: String, token: String, timestamp: NanoTimestamp, elapsedTime: NanoInterval, metadata: Map[String, String], segments: List[SegmentInfo]) diff --git a/kamon-core/src/main/scala/kamon/trace/TracingContext.scala b/kamon-core/src/main/scala/kamon/trace/TracingContext.scala index 3d324886..d34526f7 100644 --- a/kamon-core/src/main/scala/kamon/trace/TracingContext.scala +++ b/kamon-core/src/main/scala/kamon/trace/TracingContext.scala @@ -21,13 +21,13 @@ import java.util.concurrent.atomic.AtomicInteger import akka.event.LoggingAdapter import kamon.util.{ NanoInterval, RelativeNanoTimestamp, NanoTimestamp } -import kamon.metric.MetricsExtension +import kamon.metric.Metrics import scala.collection.concurrent.TrieMap private[trace] class TracingContext(traceName: String, token: String, izOpen: Boolean, levelOfDetail: LevelOfDetail, - isLocal: Boolean, startTimeztamp: RelativeNanoTimestamp, log: LoggingAdapter, metricsExtension: MetricsExtension, - traceExtension: TracerExtensionImpl, traceInfoSink: TracingContext ⇒ Unit) + isLocal: Boolean, startTimeztamp: RelativeNanoTimestamp, log: LoggingAdapter, metricsExtension: Metrics, + traceExtension: TracerImpl, traceInfoSink: TracingContext ⇒ Unit) extends MetricsOnlyContext(traceName, token, izOpen, levelOfDetail, startTimeztamp, log, metricsExtension) { private val _openSegments = new AtomicInteger(0) |