@@ -90,10 +90,6 @@ func (e Expressions) Strings() []string {
90
90
}
91
91
92
92
type Expression interface {
93
- // GetMetricDefinitionFilter returns a MetricDefinitionFilter. It takes a metric definition, looks
94
- // at its tags and returns a decision regarding this query expression applied to its tags.
95
- GetMetricDefinitionFilter () MetricDefinitionFilter
96
-
97
93
// GetDefaultDecision defines what decision should be made if the filter has not come to a conclusive
98
94
// decision based on a single index. When looking at more than one tag index in order of decreasing
99
95
// priority to decide whether a metric should be part of the final result set, some operators and metric
@@ -147,18 +143,29 @@ type Expression interface {
147
143
// GetOperator returns the operator of this expression
148
144
GetOperator () ExpressionOperator
149
145
150
- // FilterValues takes a map that's indexed by strings and applies this expression's criteria to
151
- // each of the strings, then it returns the strings that have matched
152
- // In case of expressions that get applied to tags, the first level map of the metric tag index
153
- // or meta tag index can get passed into this function, otherwise the second level under the key
154
- // returned by GetKey()
155
- ValuePasses (string ) bool
156
-
157
146
// HasRe indicates whether the evaluation of this expression involves regular expressions
158
147
HasRe () bool
159
148
160
- RequiresNonEmptyValue () bool
149
+ // OperatesOnTag returns true if this expression operators on the tag keys,
150
+ // or false if it operates on the values
161
151
OperatesOnTag () bool
152
+
153
+ // RequiresNonEmptyValue returns boolean indicating whether this expression requires a non-empty
154
+ // value. Every query must have at least one expression requiring a non-empty value, otherwise
155
+ // the query is considered invalid
156
+ RequiresNonEmptyValue () bool
157
+
158
+ // ValuePasses takes a string which should either be a tag key or value depending on the return
159
+ // value of OperatesOnTag(), then it returns a bool to indicate whether the given value satisfies
160
+ // this expression
161
+ ValuePasses (string ) bool
162
+
163
+ // GetMetricDefinitionFilter returns a MetricDefinitionFilter
164
+ // The MetricDefinitionFilter takes a metric definition, looks at its tags and returns a decision
165
+ // regarding this query expression applied to its tags
166
+ GetMetricDefinitionFilter () MetricDefinitionFilter
167
+
168
+ // StringIntoBuilder takes a builder and writes a string representation of this expression into it
162
169
StringIntoBuilder (builder * strings.Builder )
163
170
}
164
171
0 commit comments