mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-30 15:22:07 +00:00
app/vmselect/promql: fix tests after 781947a7e2
This commit is contained in:
parent
680a0d43f2
commit
bd95341190
1 changed files with 12 additions and 18 deletions
|
@ -3007,23 +3007,21 @@ func TestExecSuccess(t *testing.T) {
|
|||
t.Parallel()
|
||||
q := `sort_desc(((label_set(time(), "foo", "bar", "__name__", "q1") or label_set(10, "foo", "qwert", "__name__", "q2")) / 2) keep_metric_names)`
|
||||
r1 := netstorage.Result{
|
||||
MetricName: storage.MetricName{
|
||||
MetricGroup: []byte("q1"),
|
||||
},
|
||||
MetricName: metricNameExpected,
|
||||
Values: []float64{500, 600, 700, 800, 900, 1000},
|
||||
Timestamps: timestampsExpected,
|
||||
}
|
||||
r1.MetricName.MetricGroup = []byte("q1")
|
||||
r1.MetricName.Tags = []storage.Tag{{
|
||||
Key: []byte("foo"),
|
||||
Value: []byte("bar"),
|
||||
}}
|
||||
r2 := netstorage.Result{
|
||||
MetricName: storage.MetricName{
|
||||
MetricGroup: []byte("q2"),
|
||||
},
|
||||
MetricName: metricNameExpected,
|
||||
Values: []float64{5, 5, 5, 5, 5, 5},
|
||||
Timestamps: timestampsExpected,
|
||||
}
|
||||
r2.MetricName.MetricGroup = []byte("q2")
|
||||
r2.MetricName.Tags = []storage.Tag{{
|
||||
Key: []byte("foo"),
|
||||
Value: []byte("qwert"),
|
||||
|
@ -3070,23 +3068,21 @@ func TestExecSuccess(t *testing.T) {
|
|||
t.Parallel()
|
||||
q := `sort_desc(2 * (label_set(time(), "foo", "bar", "__name__", "q1"), label_set(10, "foo", "qwert", "__name__", "q2")) keep_metric_names)`
|
||||
r1 := netstorage.Result{
|
||||
MetricName: storage.MetricName{
|
||||
MetricGroup: []byte("q1"),
|
||||
},
|
||||
MetricName: metricNameExpected,
|
||||
Values: []float64{2000, 2400, 2800, 3200, 3600, 4000},
|
||||
Timestamps: timestampsExpected,
|
||||
}
|
||||
r1.MetricName.MetricGroup = []byte("q1")
|
||||
r1.MetricName.Tags = []storage.Tag{{
|
||||
Key: []byte("foo"),
|
||||
Value: []byte("bar"),
|
||||
}}
|
||||
r2 := netstorage.Result{
|
||||
MetricName: storage.MetricName{
|
||||
MetricGroup: []byte("q2"),
|
||||
},
|
||||
MetricName: metricNameExpected,
|
||||
Values: []float64{20, 20, 20, 20, 20, 20},
|
||||
Timestamps: timestampsExpected,
|
||||
}
|
||||
r2.MetricName.MetricGroup = []byte("q2")
|
||||
r2.MetricName.Tags = []storage.Tag{{
|
||||
Key: []byte("foo"),
|
||||
Value: []byte("qwert"),
|
||||
|
@ -3122,23 +3118,21 @@ func TestExecSuccess(t *testing.T) {
|
|||
t.Parallel()
|
||||
q := `sort_desc(2 * on() group_right() (label_set(time(), "foo", "bar", "__name__", "q1"), label_set(10, "foo", "qwert", "__name__", "q2")) keep_metric_names)`
|
||||
r1 := netstorage.Result{
|
||||
MetricName: storage.MetricName{
|
||||
MetricGroup: []byte("q1"),
|
||||
},
|
||||
MetricName: metricNameExpected,
|
||||
Values: []float64{2000, 2400, 2800, 3200, 3600, 4000},
|
||||
Timestamps: timestampsExpected,
|
||||
}
|
||||
r1.MetricName.MetricGroup = []byte("q1")
|
||||
r1.MetricName.Tags = []storage.Tag{{
|
||||
Key: []byte("foo"),
|
||||
Value: []byte("bar"),
|
||||
}}
|
||||
r2 := netstorage.Result{
|
||||
MetricName: storage.MetricName{
|
||||
MetricGroup: []byte("q2"),
|
||||
},
|
||||
MetricName: metricNameExpected,
|
||||
Values: []float64{20, 20, 20, 20, 20, 20},
|
||||
Timestamps: timestampsExpected,
|
||||
}
|
||||
r2.MetricName.MetricGroup = []byte("q2")
|
||||
r2.MetricName.Tags = []storage.Tag{{
|
||||
Key: []byte("foo"),
|
||||
Value: []byte("qwert"),
|
||||
|
|
Loading…
Reference in a new issue