public final class SimpleStats extends java.lang.Object implements TimerStats, MeterStats, CounterStats, HistogramStats
Modifier and Type | Class and Description |
---|---|
static class |
SimpleStats.Type |
TimerStats.Context
Constructor and Description |
---|
SimpleStats(java.util.concurrent.atomic.AtomicLong statsHolder,
SimpleStats.Type type) |
Modifier and Type | Method and Description |
---|---|
void |
dec()
Decrement the counter by one.
|
void |
dec(long n)
Decrement the counter by
n . |
long |
getCount()
Returns the current count.
|
void |
inc()
Increment the counter by one.
|
void |
inc(long n)
Increment the counter by
n . |
void |
mark()
Mark the occurrence of an event.
|
void |
mark(long n)
Mark the occurrence of a given number of events.
|
TimerStats.Context |
time()
Returns a new
TimerStats.Context . |
void |
update(long value)
Adds a recorded value.
|
void |
update(long duration,
java.util.concurrent.TimeUnit unit)
Adds a recorded duration.
|
public SimpleStats(java.util.concurrent.atomic.AtomicLong statsHolder, SimpleStats.Type type)
public long getCount()
Counting
public void inc()
CounterStats
inc
in interface CounterStats
public void dec()
CounterStats
dec
in interface CounterStats
public void inc(long n)
CounterStats
n
.inc
in interface CounterStats
n
- the amount by which the counter will be increasedpublic void dec(long n)
CounterStats
n
.dec
in interface CounterStats
n
- the amount by which the counter will be decreasedpublic void mark()
MeterStats
mark
in interface MeterStats
public void mark(long n)
MeterStats
mark
in interface MeterStats
n
- the number of eventspublic void update(long duration, java.util.concurrent.TimeUnit unit)
TimerStats
update
in interface TimerStats
duration
- the length of the durationunit
- the scale unit of duration
public TimerStats.Context time()
TimerStats
TimerStats.Context
.time
in interface TimerStats
TimerStats.Context
TimerStats.Context
public void update(long value)
HistogramStats
update
in interface HistogramStats
value
- the length of the valueCopyright © 2010 - 2020 Adobe. All Rights Reserved