public class StepLong extends Object implements StepValue
This class is an internal implementation detail only intended for use within spectator. It is subject to change without notice.
| Constructor and Description |
|---|
StepLong(long init,
Clock clock,
long step)
Create a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
long |
addAndGet(long now,
long value)
Increment the current value and return the result.
|
boolean |
compareAndSet(long now,
long expect,
long update)
Set the current value and return the previous value.
|
long |
getAndAdd(long now,
long value)
Increment the current value and return the value before incrementing.
|
long |
getAndIncrement(long now)
Increment the current value and return the value before incrementing.
|
long |
getAndSet(long now,
long value)
Set the current value and return the previous value.
|
long |
getCurrent()
Get the value for the current bucket.
|
long |
getCurrent(long now)
Get the value for the current bucket.
|
long |
incrementAndGet(long now)
Increment the current value and return the result.
|
void |
max(long now,
long value)
Set the current value to the maximum of the current value or the provided value.
|
void |
min(long now,
long value)
Set the current value to the minimum of the current value or the provided value.
|
long |
poll()
Get the value for the last completed interval.
|
long |
poll(long now)
Get the value for the last completed interval.
|
double |
pollAsRate()
Get the value for the last completed interval as a rate per second.
|
double |
pollAsRate(long now)
Get the value for the last completed interval as a rate per second.
|
void |
setCurrent(long now,
long value)
Set the value for the current bucket.
|
long |
timestamp()
Get the timestamp for the end of the last completed interval.
|
String |
toString() |
public StepLong(long init,
Clock clock,
long step)
public long getCurrent()
public long getCurrent(long now)
public void setCurrent(long now,
long value)
public long incrementAndGet(long now)
public long getAndIncrement(long now)
public long addAndGet(long now,
long value)
public long getAndAdd(long now,
long value)
public long getAndSet(long now,
long value)
public boolean compareAndSet(long now,
long expect,
long update)
public void min(long now,
long value)
public void max(long now,
long value)
public long poll()
public long poll(long now)
public double pollAsRate()
pollAsRate in interface StepValuepublic double pollAsRate(long now)
pollAsRate in interface StepValuepublic long timestamp()