diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2017-05-03 12:11:47 +0200 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2017-05-03 12:11:47 +0200 |
commit | 5dee54a0794b282e9b5729a3d4b85478c12a68d1 (patch) | |
tree | 078513a1cddcb66990a11427b2ebdcb2da46f87b /kamon-core/src/main/scala/kamon/Kamon.scala | |
parent | 4247aa319ac6e17b7ef7a76d61bac32c872575e3 (diff) | |
download | Kamon-5dee54a0794b282e9b5729a3d4b85478c12a68d1.tar.gz Kamon-5dee54a0794b282e9b5729a3d4b85478c12a68d1.tar.bz2 Kamon-5dee54a0794b282e9b5729a3d4b85478c12a68d1.zip |
handle reporters shutdown and reconfigures
Diffstat (limited to 'kamon-core/src/main/scala/kamon/Kamon.scala')
-rw-r--r-- | kamon-core/src/main/scala/kamon/Kamon.scala | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/kamon-core/src/main/scala/kamon/Kamon.scala b/kamon-core/src/main/scala/kamon/Kamon.scala index 72573a8a..316a9a24 100644 --- a/kamon-core/src/main/scala/kamon/Kamon.scala +++ b/kamon-core/src/main/scala/kamon/Kamon.scala @@ -12,26 +12,25 @@ import kamon.trace.Tracer * * */ -trait Kamon { - def metrics: RecorderRegistry - def tracer: Tracer - - def subscriptions: Reporters - def util: Util +object Kamon { + private val recorderRegistry = new RecorderRegistryImpl(ConfigFactory.load()) + private val reporterRegistry = new ReporterRegistryImpl(recorderRegistry, ConfigFactory.load()) - def environment: Environment - def diagnose: Diagnostic + def metrics: RecorderRegistry = recorderRegistry + def reporters: ReporterRegistry = reporterRegistry - def reconfigure(config: Config): Unit + def reconfigure(config: Config): Unit = synchronized { + recorderRegistry.reconfigure(config) + reporterRegistry.reconfigure(config) + } -} + def tracer: Tracer = ??? + def environment: Environment = ??? + def diagnose: Diagnostic = ??? + def util: Util = ??? -object Kamon { - val metricsModule = new RecorderRegistryImpl(ConfigFactory.load()) - val reports = new ReportersRegistry(metricsModule) - def metrics: RecorderRegistry = metricsModule } |