public class StepCounter
extends java.lang.Object
implements com.netflix.spectator.api.Counter
count()
will report the number events in the last complete interval rather than the total for
the life of the process.Constructor and Description |
---|
StepCounter(com.netflix.spectator.api.Id id,
com.netflix.spectator.api.Clock clock,
long step)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
long |
count() |
boolean |
hasExpired() |
com.netflix.spectator.api.Id |
id() |
void |
increment() |
void |
increment(long amount) |
java.lang.Iterable<com.netflix.spectator.api.Measurement> |
measure() |
public StepCounter(com.netflix.spectator.api.Id id, com.netflix.spectator.api.Clock clock, long step)
public com.netflix.spectator.api.Id id()
id
in interface com.netflix.spectator.api.Meter
public boolean hasExpired()
hasExpired
in interface com.netflix.spectator.api.Meter
public java.lang.Iterable<com.netflix.spectator.api.Measurement> measure()
measure
in interface com.netflix.spectator.api.Meter
public void increment()
increment
in interface com.netflix.spectator.api.Counter
public void increment(long amount)
increment
in interface com.netflix.spectator.api.Counter
public long count()
count
in interface com.netflix.spectator.api.Counter