mirror of https://github.com/prometheus/prometheus
Run ``make format``.
parent
caeb759ed7
commit
615e6d13d7
|
@ -175,7 +175,7 @@ func (g *getValuesAlongRangeOp) ExtractSamples(in []model.SamplePair) (out []mod
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
lastSampleTime := in[lastIdx - 1].Timestamp
|
lastSampleTime := in[lastIdx-1].Timestamp
|
||||||
g.from = lastSampleTime.Add(time.Duration(1))
|
g.from = lastSampleTime.Add(time.Duration(1))
|
||||||
return in[firstIdx:lastIdx]
|
return in[firstIdx:lastIdx]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1487,15 +1487,15 @@ func TestGetValuesAlongRangeOp(t *testing.T) {
|
||||||
// No values.
|
// No values.
|
||||||
{
|
{
|
||||||
op: getValuesAlongRangeOp{
|
op: getValuesAlongRangeOp{
|
||||||
from: testInstant,
|
from: testInstant,
|
||||||
through: testInstant.Add(1 * time.Minute),
|
through: testInstant.Add(1 * time.Minute),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Entire operator range before first value.
|
// Entire operator range before first value.
|
||||||
{
|
{
|
||||||
op: getValuesAlongRangeOp{
|
op: getValuesAlongRangeOp{
|
||||||
from: testInstant,
|
from: testInstant,
|
||||||
through: testInstant.Add(1 * time.Minute),
|
through: testInstant.Add(1 * time.Minute),
|
||||||
},
|
},
|
||||||
in: []model.SamplePair{
|
in: []model.SamplePair{
|
||||||
{
|
{
|
||||||
|
@ -1512,8 +1512,8 @@ func TestGetValuesAlongRangeOp(t *testing.T) {
|
||||||
// Operator range starts before first value, ends within available values.
|
// Operator range starts before first value, ends within available values.
|
||||||
{
|
{
|
||||||
op: getValuesAlongRangeOp{
|
op: getValuesAlongRangeOp{
|
||||||
from: testInstant,
|
from: testInstant,
|
||||||
through: testInstant.Add(2 * time.Minute),
|
through: testInstant.Add(2 * time.Minute),
|
||||||
},
|
},
|
||||||
in: []model.SamplePair{
|
in: []model.SamplePair{
|
||||||
{
|
{
|
||||||
|
@ -1535,8 +1535,8 @@ func TestGetValuesAlongRangeOp(t *testing.T) {
|
||||||
// Entire operator range is within available values.
|
// Entire operator range is within available values.
|
||||||
{
|
{
|
||||||
op: getValuesAlongRangeOp{
|
op: getValuesAlongRangeOp{
|
||||||
from: testInstant.Add(1 * time.Minute),
|
from: testInstant.Add(1 * time.Minute),
|
||||||
through: testInstant.Add(2 * time.Minute),
|
through: testInstant.Add(2 * time.Minute),
|
||||||
},
|
},
|
||||||
in: []model.SamplePair{
|
in: []model.SamplePair{
|
||||||
{
|
{
|
||||||
|
@ -1562,8 +1562,8 @@ func TestGetValuesAlongRangeOp(t *testing.T) {
|
||||||
// Operator range begins before first value, ends after last.
|
// Operator range begins before first value, ends after last.
|
||||||
{
|
{
|
||||||
op: getValuesAlongRangeOp{
|
op: getValuesAlongRangeOp{
|
||||||
from: testInstant,
|
from: testInstant,
|
||||||
through: testInstant.Add(3 * time.Minute),
|
through: testInstant.Add(3 * time.Minute),
|
||||||
},
|
},
|
||||||
in: []model.SamplePair{
|
in: []model.SamplePair{
|
||||||
{
|
{
|
||||||
|
@ -1589,8 +1589,8 @@ func TestGetValuesAlongRangeOp(t *testing.T) {
|
||||||
// Operator range begins within available values, ends after the last value.
|
// Operator range begins within available values, ends after the last value.
|
||||||
{
|
{
|
||||||
op: getValuesAlongRangeOp{
|
op: getValuesAlongRangeOp{
|
||||||
from: testInstant.Add(2 * time.Minute),
|
from: testInstant.Add(2 * time.Minute),
|
||||||
through: testInstant.Add(4 * time.Minute),
|
through: testInstant.Add(4 * time.Minute),
|
||||||
},
|
},
|
||||||
in: []model.SamplePair{
|
in: []model.SamplePair{
|
||||||
{
|
{
|
||||||
|
@ -1624,8 +1624,8 @@ func TestGetValuesAlongRangeOp(t *testing.T) {
|
||||||
// Entire operator range after the last available value.
|
// Entire operator range after the last available value.
|
||||||
{
|
{
|
||||||
op: getValuesAlongRangeOp{
|
op: getValuesAlongRangeOp{
|
||||||
from: testInstant.Add(2 * time.Minute),
|
from: testInstant.Add(2 * time.Minute),
|
||||||
through: testInstant.Add(3 * time.Minute),
|
through: testInstant.Add(3 * time.Minute),
|
||||||
},
|
},
|
||||||
in: []model.SamplePair{
|
in: []model.SamplePair{
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue