diff options
Diffstat (limited to 'kamon-core')
-rw-r--r-- | kamon-core/src/main/scala/kamon/Kamon.scala | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/kamon-core/src/main/scala/kamon/Kamon.scala b/kamon-core/src/main/scala/kamon/Kamon.scala index f07f846b..d29061f8 100644 --- a/kamon-core/src/main/scala/kamon/Kamon.scala +++ b/kamon-core/src/main/scala/kamon/Kamon.scala @@ -24,12 +24,18 @@ class Kamon(val actorSystem: ActorSystem) { val metrics: MetricsExtension = Metrics.get(actorSystem) val tracer: TracerExtension = Tracer.get(actorSystem) val userMetrics: UserMetricsExtension = UserMetrics.get(actorSystem) + + def shutdown: Unit = + actorSystem.shutdown() } object Kamon { trait Extension extends actor.Extension def apply[T <: Extension](key: ExtensionId[T])(implicit system: ActorSystem): T = key(system) + def apply(): Kamon = + apply("kamon") + def apply(actorSystemName: String): Kamon = apply(ActorSystem(actorSystemName)) @@ -38,4 +44,17 @@ object Kamon { def apply(system: ActorSystem): Kamon = new Kamon(system) + + def create(): Kamon = + apply() + + def create(actorSystemName: String): Kamon = + apply(ActorSystem(actorSystemName)) + + def create(actorSystemName: String, config: Config): Kamon = + apply(ActorSystem(actorSystemName, config)) + + def create(system: ActorSystem): Kamon = + new Kamon(system) + }
\ No newline at end of file |