From aa93757d615d805a9b6c30541055601b0df22951 Mon Sep 17 00:00:00 2001 From: Ivan Topolnjak Date: Mon, 14 Mar 2016 21:59:02 +0100 Subject: introduce selective instrumentation for akka actors. --- kamon-core/src/main/scala/kamon/metric/EntityRecorder.scala | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'kamon-core/src/main/scala/kamon/metric') diff --git a/kamon-core/src/main/scala/kamon/metric/EntityRecorder.scala b/kamon-core/src/main/scala/kamon/metric/EntityRecorder.scala index 15e20d1a..e1e89b79 100644 --- a/kamon-core/src/main/scala/kamon/metric/EntityRecorder.scala +++ b/kamon-core/src/main/scala/kamon/metric/EntityRecorder.scala @@ -34,6 +34,12 @@ trait EntityRecorderFactory[T <: EntityRecorder] { def createRecorder(instrumentFactory: InstrumentFactory): T } +abstract class EntityRecorderFactoryCompanion[T <: EntityRecorder](val category: String, builder: (InstrumentFactory) => T) + extends EntityRecorderFactory[T] { + + def createRecorder(instrumentFactory: InstrumentFactory): T = builder(instrumentFactory) +} + object EntityRecorderFactory { def apply[T <: EntityRecorder](entityCategory: String, factory: InstrumentFactory ⇒ T): EntityRecorderFactory[T] = new EntityRecorderFactory[T] { -- cgit v1.2.3