public interface Consolidator
Modifier and Type | Interface and Description |
---|---|
static class |
Consolidator.AbstractConsolidator
Base class for consolidator implementations.
|
static class |
Consolidator.Avg
Averages the raw values.
|
static class |
Consolidator.Max
Selects the maximum value that is reported.
|
static class |
Consolidator.None
Placeholder implementation used when the primary and consolidated step sizes are
the same.
|
Modifier and Type | Method and Description |
---|---|
static Consolidator |
create(com.netflix.spectator.api.Id id,
long step,
int multiple)
Create a new consolidator instance based on the statistic in the id.
|
static Consolidator |
create(com.netflix.spectator.api.Statistic statistic,
long step,
int multiple)
Create a new consolidator instance based on the specified statistic.
|
static Consolidator |
create(String statistic,
long step,
int multiple)
Create a new consolidator instance based on the specified statistic.
|
boolean |
isEmpty()
Returns true if the state is the same as it would be if a new instance of the consolidator
was created.
|
boolean |
isGauge()
Returns true if this consolidator is intended for gauge values.
|
static boolean |
isGauge(String statistic) |
void |
update(long t,
double v)
Update the state with a new primary datapoint.
|
default void |
update(com.netflix.spectator.api.Measurement m)
Update the state with a new primary datapoint.
|
double |
value(long t)
Return the consolidated value for the specified timestamp.
|
void update(long t, double v)
t
- Timestamp for the new value.v
- Value to include in the consolidated aggregate. If there is no new measurement, then
NaN
can be used to force the completion of the consolidated value.default void update(com.netflix.spectator.api.Measurement m)
update(long, double)
for more
details.double value(long t)
boolean isEmpty()
boolean isGauge()
static Consolidator create(com.netflix.spectator.api.Id id, long step, int multiple)
id
- Id for the measurement to consolidate.step
- Consolidated step size.multiple
- Multiple for the consolidate step size. The primary step is step / multiple
.static Consolidator create(com.netflix.spectator.api.Statistic statistic, long step, int multiple)
statistic
- Statistic used to determine which consolidation function to use.step
- Consolidated step size.multiple
- Multiple for the consolidate step size. The primary step is step / multiple
.static Consolidator create(String statistic, long step, int multiple)
statistic
- Statistic used to determine which consolidation function to use. If the statistic is
null or unknown, the it will be treated as a gauge.step
- Consolidated step size.multiple
- Multiple for the consolidate step size. The primary step is step / multiple
.static boolean isGauge(String statistic)