public class Evaluator extends Object
Classes in this package are only intended for use internally within spectator. They may change at any time and without notice.
Constructor and Description |
---|
Evaluator(EvaluatorConfig config)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
EvalPayload |
eval(long timestamp)
Evaluate the expressions for all subscriptions against the data available for the provided
timestamp.
|
EvalPayload |
eval(long t,
List<com.netflix.spectator.api.Measurement> ms)
Helper function that evaluates the data for a given time after updating with the
provided list of measurements.
|
void |
sync(List<Subscription> subs)
Synchronize the set of subscriptions for this evaluator with the provided set.
|
void |
update(com.netflix.spectator.api.Id id,
long t,
double v)
Update the state for the expressions to be evaluated with the provided datapoint.
|
void |
update(com.netflix.spectator.api.Measurement m)
Update the state.
|
public Evaluator(EvaluatorConfig config)
config
- Config settings to tune the evaluation behavior.public void sync(List<Subscription> subs)
public void update(com.netflix.spectator.api.Measurement m)
update(Id, long, double)
for more information.public void update(com.netflix.spectator.api.Id id, long t, double v)
id
- Id for the datapoint. The value will be collected for each expression where the
id satisfies the query constraints.t
- Timestamp for the datapoint. It should be on a boundary for the step interval.v
- Value for the datapoint.public EvalPayload eval(long timestamp)
update(Id, long, double)
prior to
performing the evaluation.timestamp
- Timestamp for the interval to evaluate.public EvalPayload eval(long t, List<com.netflix.spectator.api.Measurement> ms)
t
- Timestamp for the interval to evaluate.ms
- List of measurements to include before performing the evaluation.