|
1 | 1 | /* =========================================================================================
|
2 |
| - * Copyright © 2013-2017 the kamon project <http://kamon.io/> |
| 2 | + * Copyright © 2013-2019 the kamon project <http://kamon.io/> |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
|
5 | 5 | * 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 {
|
36 | 36 | @volatile private var _environment = Environment.fromConfig(_config)
|
37 | 37 | @volatile private var _filters = Filters.fromConfig(_config)
|
38 | 38 |
|
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) |
46 | 46 | private var _onReconfigureHooks = Seq.empty[OnReconfigureHook]
|
47 | 47 |
|
48 | 48 | sys.addShutdownHook(() => _scheduler.shutdown())
|
|
0 commit comments