diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2015-01-29 03:42:27 +0100 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2015-01-29 03:42:27 +0100 |
commit | a80034229b12d42b420a9b2cc10bf23f8c5f613b (patch) | |
tree | 812d3756ffb1dd74f014a07959c79fd2e651f943 /kamon-core/src/main/scala/kamon/Kamon.scala | |
parent | 1f873f6f28b92db54d97ce82c967866de41008d1 (diff) | |
parent | edceb598dd986c7a0b22f2f89e8dc9f8c0da19e8 (diff) | |
download | Kamon-a80034229b12d42b420a9b2cc10bf23f8c5f613b.tar.gz Kamon-a80034229b12d42b420a9b2cc10bf23f8c5f613b.tar.bz2 Kamon-a80034229b12d42b420a9b2cc10bf23f8c5f613b.zip |
Merge branch 'wip/improve-metric-recorders-infrastructure'
Conflicts:
kamon-system-metrics/src/main/scala/kamon/system/SystemMetricsCollector.scala
Diffstat (limited to 'kamon-core/src/main/scala/kamon/Kamon.scala')
-rw-r--r-- | kamon-core/src/main/scala/kamon/Kamon.scala | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/kamon-core/src/main/scala/kamon/Kamon.scala b/kamon-core/src/main/scala/kamon/Kamon.scala index 00026b77..f07f846b 100644 --- a/kamon-core/src/main/scala/kamon/Kamon.scala +++ b/kamon-core/src/main/scala/kamon/Kamon.scala @@ -16,9 +16,26 @@ package kamon import _root_.akka.actor import _root_.akka.actor._ +import com.typesafe.config.Config +import kamon.metric._ +import kamon.trace.{ Tracer, TracerExtension } + +class Kamon(val actorSystem: ActorSystem) { + val metrics: MetricsExtension = Metrics.get(actorSystem) + val tracer: TracerExtension = Tracer.get(actorSystem) + val userMetrics: UserMetricsExtension = UserMetrics.get(actorSystem) +} object Kamon { trait Extension extends actor.Extension def apply[T <: Extension](key: ExtensionId[T])(implicit system: ActorSystem): T = key(system) -} + def apply(actorSystemName: String): Kamon = + apply(ActorSystem(actorSystemName)) + + def apply(actorSystemName: String, config: Config): Kamon = + apply(ActorSystem(actorSystemName, config)) + + def apply(system: ActorSystem): Kamon = + new Kamon(system) +}
\ No newline at end of file |