diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2017-05-25 16:52:52 +0200 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2017-05-25 16:52:52 +0200 |
commit | a3d78ef61a277b0b62dc93daf84756dfa7625d3d (patch) | |
tree | 4fee7ce93ecfb4e32c7aaaa22efb75ed07c667f6 /kamon-core/src/main/scala/kamon/metric/instrument/Counter.scala | |
parent | 22379d3f318b2cd3a4c995ff1c45bda33d935a46 (diff) | |
download | Kamon-a3d78ef61a277b0b62dc93daf84756dfa7625d3d.tar.gz Kamon-a3d78ef61a277b0b62dc93daf84756dfa7625d3d.tar.bz2 Kamon-a3d78ef61a277b0b62dc93daf84756dfa7625d3d.zip |
trying to flatten out the structure and eliminate the notion of entitites
Diffstat (limited to 'kamon-core/src/main/scala/kamon/metric/instrument/Counter.scala')
-rw-r--r-- | kamon-core/src/main/scala/kamon/metric/instrument/Counter.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kamon-core/src/main/scala/kamon/metric/instrument/Counter.scala b/kamon-core/src/main/scala/kamon/metric/instrument/Counter.scala index 10b9c3a6..f18e771c 100644 --- a/kamon-core/src/main/scala/kamon/metric/instrument/Counter.scala +++ b/kamon-core/src/main/scala/kamon/metric/instrument/Counter.scala @@ -14,8 +14,8 @@ trait Counter { def increment(times: Long): Unit } -class LongAdderCounter(entity: Entity, name: String, val measurementUnit: MeasurementUnit) - extends Counter with SingleValueSnapshotInstrument with StrictLogging { +class LongAdderCounter(name: String, tags: Map[String, String], val measurementUnit: MeasurementUnit) + extends SnapshotableCounter with StrictLogging { private val adder = new LongAdder() @@ -26,9 +26,9 @@ class LongAdderCounter(entity: Entity, name: String, val measurementUnit: Measur if (times >= 0) adder.add(times) else - logger.warn(s"Ignored attempt to decrement counter [$name] on entity [$entity]") + logger.warn(s"Ignored attempt to decrement counter [$name]") } def snapshot(): SingleValueSnapshot = - SingleValueSnapshot(name, measurementUnit, adder.sumThenReset()) + SingleValueSnapshot(name, tags, measurementUnit, adder.sumThenReset()) } |