public static enum ConditionExpression.EvalType extends Enum<ConditionExpression.EvalType>
ConditionExpression.Query.metrics
and ConditionExpression.Query.tags fields define the set of metrics will be involved in the query. The query
will result in a set of data points for each metric. This field defines how to perform the
ConditionExpression.eval for the resulting data points.
ALL means that the data points for all of the metrics will be combined, then aggregated, and
ConditionExpression.eval is resolved one time (per run of the ConditionExpression). At most one Event
will be sent to Alerting if ConditionExpression.eval resolves to true.
EACH means that the data points for each metric will be aggregated separately.
ConditionExpression.eval is resolved N times, once for each metric. Up to N Events
could be sent to Alerting depending on how often ConditionExpression.eval resolves to true.
For example, assume we are dealing with two metrics, M1 and M2, the eval is "q(qNow,avg) > 100", and qNow is define with an interval of 1h. On each run we get the M1 and M2 data points for the most recent hour. Using ALL we combine all of the datapoints, generate the average, and resolve the expression. If true we send an Event to alerting. Using EACH we keep the data points for each metric separate, generate the average for each, and resolve the expression for each. For each true resolution we send an Event to Alerting. Note that to distinguish the events we provide the metric name in the Event context. For example, like context={"MetricName":"M1"}.
A Note tabout using EACH/b>. If multiple queries are involved in the eval expression then that only metrics common to each query will be evaluated. For example, if the eval abbove were "q(qNow,avg) > q(qYesterday,avg)" and only M1 were common to both queries then the eval would only be resolved using M1 data points. In general each query will likely use the same metrics so this issue is a corner case.
The default is ALL.| Modifier and Type | Method and Description |
|---|---|
static ConditionExpression.EvalType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ConditionExpression.EvalType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ConditionExpression.EvalType ALL
public static final ConditionExpression.EvalType EACH
public static ConditionExpression.EvalType[] values()
for (ConditionExpression.EvalType c : ConditionExpression.EvalType.values()) System.out.println(c);
public static ConditionExpression.EvalType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2014–2017 Red Hat, Inc.. All rights reserved.