diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2017-05-25 16:52:52 +0200 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2017-05-25 16:52:52 +0200 |
commit | a3d78ef61a277b0b62dc93daf84756dfa7625d3d (patch) | |
tree | 4fee7ce93ecfb4e32c7aaaa22efb75ed07c667f6 /kamon-core/src/main/scala/kamon/Kamon.scala | |
parent | 22379d3f318b2cd3a4c995ff1c45bda33d935a46 (diff) | |
download | Kamon-a3d78ef61a277b0b62dc93daf84756dfa7625d3d.tar.gz Kamon-a3d78ef61a277b0b62dc93daf84756dfa7625d3d.tar.bz2 Kamon-a3d78ef61a277b0b62dc93daf84756dfa7625d3d.zip |
trying to flatten out the structure and eliminate the notion of entitites
Diffstat (limited to 'kamon-core/src/main/scala/kamon/Kamon.scala')
-rw-r--r-- | kamon-core/src/main/scala/kamon/Kamon.scala | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/kamon-core/src/main/scala/kamon/Kamon.scala b/kamon-core/src/main/scala/kamon/Kamon.scala index b318d59d..60956ee0 100644 --- a/kamon-core/src/main/scala/kamon/Kamon.scala +++ b/kamon-core/src/main/scala/kamon/Kamon.scala @@ -3,22 +3,24 @@ package kamon import java.util.concurrent.atomic.AtomicReference import com.typesafe.config.{Config, ConfigFactory} -import kamon.metric.{RecorderRegistry, RecorderRegistryImpl} +import kamon.metric.instrument.{DynamicRange, Histogram} +import kamon.metric.{MetricLookup, Registry} import kamon.trace.Tracer +import kamon.util.MeasurementUnit -object Kamon { +object Kamon extends MetricLookup { private val _initialConfig = ConfigFactory.load() - private val _recorderRegistry = new RecorderRegistryImpl(_initialConfig) - private val _reporterRegistry = new ReporterRegistryImpl(_recorderRegistry, _initialConfig) - private val _tracer = new Tracer(_recorderRegistry, _reporterRegistry) + //private val _recorderRegistry = new RecorderRegistryImpl(_initialConfig) + private val _reporterRegistry = new ReporterRegistryImpl(???, _initialConfig) + private val _tracer = new Tracer(???, _reporterRegistry) private val _environment = new AtomicReference[Environment](environmentFromConfig(ConfigFactory.load())) def tracer: io.opentracing.Tracer = _tracer - def metrics: RecorderRegistry = - _recorderRegistry +// def metrics: RecorderRegistry = +// _recorderRegistry def reporters: ReporterRegistry = _reporterRegistry @@ -27,13 +29,15 @@ object Kamon { _environment.get() def reconfigure(config: Config): Unit = synchronized { - _recorderRegistry.reconfigure(config) + // _recorderRegistry.reconfigure(config) _reporterRegistry.reconfigure(config) _environment.set(environmentFromConfig(config)) } - + private val metricRegistry = new Registry(_initialConfig) + override def histogram(name: String, unit: MeasurementUnit, tags: Map[String, String], dynamicRange: Option[DynamicRange]): Histogram = + metricRegistry.histogram(name, unit, tags, dynamicRange) case class Environment(config: Config, application: String, host: String, instance: String) |