Skip to content

Commit cb528e4

Browse files
committed
* Update Hdr
* lazy vals in Kamon in order to avoid weird race conditions on startup
1 parent 1dd43d6 commit cb528e4

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

build.sbt

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ lazy val kamon = (project in file("."))
2020
.aggregate(core, testkit, coreTests)
2121

2222
val commonSettings = Seq(
23-
scalaVersion := "2.12.4",
23+
scalaVersion := "2.12.8",
2424
javacOptions += "-XDignore.symbol.file",
2525
resolvers += Resolver.mavenLocal,
26-
crossScalaVersions := Seq("2.12.4", "2.11.8", "2.10.6"),
26+
crossScalaVersions := Seq("2.12.8", "2.11.12", "2.10.7"),
2727
concurrentRestrictions in Global += Tags.limit(Tags.Test, 1),
2828
scalacOptions ++= Seq(
2929
"-deprecation",
@@ -47,7 +47,7 @@ lazy val core = (project in file("kamon-core"))
4747
libraryDependencies ++= Seq(
4848
"com.typesafe" % "config" % "1.3.1",
4949
"org.slf4j" % "slf4j-api" % "1.7.25",
50-
"org.hdrhistogram" % "HdrHistogram" % "2.1.9",
50+
"org.hdrhistogram" % "HdrHistogram" % "2.1.11",
5151
"com.lihaoyi" %% "fansi" % "0.2.4"
5252
)
5353
)

kamon-core/src/main/scala/kamon/Kamon.scala

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* =========================================================================================
2-
* Copyright © 2013-2017 the kamon project <http://kamon.io/>
2+
* Copyright © 2013-2019 the kamon project <http://kamon.io/>
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
55
* 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 {
3636
@volatile private var _environment = Environment.fromConfig(_config)
3737
@volatile private var _filters = Filters.fromConfig(_config)
3838

39-
private val _clock = new Clock.Default()
40-
private val _scheduler = Executors.newScheduledThreadPool(schedulerPoolSize(_config), numberedThreadFactory("kamon-scheduler", daemon = true))
41-
private val _metrics = new MetricRegistry(_config, _scheduler)
42-
private val _reporterRegistry = new ReporterRegistry.Default(_metrics, _config, _clock)
43-
private val _tracer = Tracer.Default(Kamon, _reporterRegistry, _config, _clock)
44-
private val _contextStorage = Storage.ThreadLocal()
45-
private val _contextCodec = new Codecs(_config)
39+
private lazy val _clock = new Clock.Default()
40+
private lazy val _scheduler = Executors.newScheduledThreadPool(schedulerPoolSize(_config), numberedThreadFactory("kamon-scheduler", daemon = true))
41+
private lazy val _metrics = new MetricRegistry(_config, _scheduler)
42+
private lazy val _reporterRegistry = new ReporterRegistry.Default(_metrics, _config, _clock)
43+
private lazy val _tracer = Tracer.Default(Kamon, _reporterRegistry, _config, _clock)
44+
private lazy val _contextStorage = Storage.ThreadLocal()
45+
private lazy val _contextCodec = new Codecs(_config)
4646
private var _onReconfigureHooks = Seq.empty[OnReconfigureHook]
4747

4848
sys.addShutdownHook(() => _scheduler.shutdown())

0 commit comments

Comments
 (0)