diff --git a/build.sbt b/build.sbt index 5c2cc1043..8c0d992e3 100644 --- a/build.sbt +++ b/build.sbt @@ -20,10 +20,10 @@ lazy val kamon = (project in file(".")) .aggregate(core, testkit, coreTests) val commonSettings = Seq( - scalaVersion := "2.12.4", + scalaVersion := "2.12.8", javacOptions += "-XDignore.symbol.file", resolvers += Resolver.mavenLocal, - crossScalaVersions := Seq("2.12.4", "2.11.8", "2.10.6"), + crossScalaVersions := Seq("2.12.8", "2.11.12", "2.10.7"), concurrentRestrictions in Global += Tags.limit(Tags.Test, 1), scalacOptions ++= Seq( "-deprecation", @@ -47,7 +47,7 @@ lazy val core = (project in file("kamon-core")) libraryDependencies ++= Seq( "com.typesafe" % "config" % "1.3.1", "org.slf4j" % "slf4j-api" % "1.7.25", - "org.hdrhistogram" % "HdrHistogram" % "2.1.9", + "org.hdrhistogram" % "HdrHistogram" % "2.1.11", "com.lihaoyi" %% "fansi" % "0.2.4" ) ) diff --git a/kamon-core/src/main/scala/kamon/Kamon.scala b/kamon-core/src/main/scala/kamon/Kamon.scala index 8f69ab419..720e0dfb4 100644 --- a/kamon-core/src/main/scala/kamon/Kamon.scala +++ b/kamon-core/src/main/scala/kamon/Kamon.scala @@ -1,5 +1,5 @@ /* ========================================================================================= - * Copyright © 2013-2017 the kamon project + * Copyright © 2013-2019 the kamon project * * 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 @@ -36,13 +36,13 @@ object Kamon extends MetricLookup with ReporterRegistry with Tracer { @volatile private var _environment = Environment.fromConfig(_config) @volatile private var _filters = Filters.fromConfig(_config) - private val _clock = new Clock.Default() - private val _scheduler = Executors.newScheduledThreadPool(schedulerPoolSize(_config), numberedThreadFactory("kamon-scheduler", daemon = true)) - private val _metrics = new MetricRegistry(_config, _scheduler) - private val _reporterRegistry = new ReporterRegistry.Default(_metrics, _config, _clock) - private val _tracer = Tracer.Default(Kamon, _reporterRegistry, _config, _clock) - private val _contextStorage = Storage.ThreadLocal() - private val _contextCodec = new Codecs(_config) + private lazy val _clock = new Clock.Default() + private lazy val _scheduler = Executors.newScheduledThreadPool(schedulerPoolSize(_config), numberedThreadFactory("kamon-scheduler", daemon = true)) + private lazy val _metrics = new MetricRegistry(_config, _scheduler) + private lazy val _reporterRegistry = new ReporterRegistry.Default(_metrics, _config, _clock) + private lazy val _tracer = Tracer.Default(Kamon, _reporterRegistry, _config, _clock) + private lazy val _contextStorage = Storage.ThreadLocal() + private lazy val _contextCodec = new Codecs(_config) private var _onReconfigureHooks = Seq.empty[OnReconfigureHook] sys.addShutdownHook(() => _scheduler.shutdown())