public class LongGauge extends AtomicLong implements com.codahale.metrics.Metric, com.codahale.metrics.Gauge<Long>
AtomicLong which acts as a metrics gauge: its state can be exposed as
a metrics.
It also exposes some of the same method names as the Codahale Counter class, so that
it's easy to swap in.| Constructor and Description |
|---|
LongGauge()
Instantiate with value 0
|
LongGauge(long val)
Instantiate
|
| Modifier and Type | Method and Description |
|---|---|
void |
dec()
-- |
long |
decToFloor(long delta)
Decrement to the floor of 0.
|
Long |
getCount()
Method from ; used here for drop-in replacement
without any recompile
|
Long |
getValue()
Get the value as a metric
|
void |
inc()
++ |
addAndGet, compareAndSet, decrementAndGet, doubleValue, floatValue, get, getAndAdd, getAndDecrement, getAndIncrement, getAndSet, incrementAndGet, intValue, lazySet, longValue, set, toString, weakCompareAndSetbyteValue, shortValuepublic LongGauge(long val)
val - current valuepublic LongGauge()
public Long getValue()
getValue in interface com.codahale.metrics.Gauge<Long>public Long getCount()
public void inc()
++public void dec()
--public long decToFloor(long delta)
delta - deltaCopyright © 2014–2015 The Apache Software Foundation. All rights reserved.