diff options
author | Ivan Topolnak <ivantopo@gmail.com> | 2013-06-11 18:29:17 -0300 |
---|---|---|
committer | Ivan Topolnak <ivantopo@gmail.com> | 2013-06-11 18:29:17 -0300 |
commit | 84c9ae342ea4a280b0033d9d78239b19b01b728f (patch) | |
tree | 7cc9730bc8f0c89410f4655988922e2b679549b5 /src/main/scala/kamon/metric/GaugeGenerator.scala | |
parent | 197746563e47783ed4b5f43e94c9aa63734081f6 (diff) | |
download | Kamon-84c9ae342ea4a280b0033d9d78239b19b01b728f.tar.gz Kamon-84c9ae342ea4a280b0033d9d78239b19b01b728f.tar.bz2 Kamon-84c9ae342ea4a280b0033d9d78239b19b01b728f.zip |
wip
Diffstat (limited to 'src/main/scala/kamon/metric/GaugeGenerator.scala')
-rw-r--r-- | src/main/scala/kamon/metric/GaugeGenerator.scala | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/scala/kamon/metric/GaugeGenerator.scala b/src/main/scala/kamon/metric/GaugeGenerator.scala new file mode 100644 index 00000000..30635432 --- /dev/null +++ b/src/main/scala/kamon/metric/GaugeGenerator.scala @@ -0,0 +1,12 @@ +package kamon.metric + +import com.codahale.metrics.Gauge + +trait GaugeGenerator { + + def newNumericGaugeFor[T, V >: AnyVal](target: T)(generator: T => V) = new Gauge[V] { + def getValue: V = generator(target) + } +} + +object GaugeGenerator extends GaugeGenerator |