Skip to content

Commit

Permalink
* Update Hdr
Browse files Browse the repository at this point in the history
* lazy vals in Kamon in order to avoid weird race conditions on startup
  • Loading branch information
dpsoft committed Jan 23, 2019
1 parent 1dd43d6 commit cb528e4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
)
)
Expand Down
16 changes: 8 additions & 8 deletions kamon-core/src/main/scala/kamon/Kamon.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* =========================================================================================
* Copyright © 2013-2017 the kamon project <http://kamon.io/>
* Copyright © 2013-2019 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
Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit cb528e4

Please sign in to comment.