diff options
Diffstat (limited to 'kamon-core/src/main/scala/kamon/metric/EntityRecorder.scala')
-rw-r--r-- | kamon-core/src/main/scala/kamon/metric/EntityRecorder.scala | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kamon-core/src/main/scala/kamon/metric/EntityRecorder.scala b/kamon-core/src/main/scala/kamon/metric/EntityRecorder.scala index 71b40ea6..c1392d4d 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] { |