Skip to content

Commit

Permalink
Adjust generated samples
Browse files Browse the repository at this point in the history
Signed-off-by: Kemal Akkoyun <[email protected]>
  • Loading branch information
kakkoyun committed Mar 16, 2020
1 parent f00b1c8 commit cbd3ca1
Showing 1 changed file with 8 additions and 43 deletions.
51 changes: 8 additions & 43 deletions test/e2e/compact_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,49 +159,14 @@ func TestCompact(t *testing.T) {
extLset: labels.FromStrings("ext1", "value1", "replica", "1"),
mint: timestamp.FromTime(now),
maxt: timestamp.FromTime(now.Add(2 * time.Hour)),
samplesPerSeries: 120,
samplesPerSeries: 119,
},
{
series: []labels.Labels{labels.FromStrings("a", "1", "b", "2")},
extLset: labels.FromStrings("ext1", "value1", "replica", "2"),
mint: timestamp.FromTime(now),
maxt: timestamp.FromTime(now.Add(1 * time.Hour)),
samplesPerSeries: 60,
},
},
replicaLabels: []string{"replica"},
downsamplingEnabled: true,
query: "{a=\"1\"}",

expected: []model.Metric{
{
"a": "1",
"b": "2",
"ext1": "value1",
},
},
expectOfModBlocks: 2,
expectOfBlocks: 1,
expectOfSamples: 179, // TODO(kakkoyun): ?
expectOfSeries: 1,
expectOfChunks: 2,
},
{
name: "(contains) vertically overlapping blocks with replica labels",
blocks: []blockDesc{
{
series: []labels.Labels{labels.FromStrings("a", "1", "b", "2")},
extLset: labels.FromStrings("ext1", "value1", "replica", "1"),
mint: timestamp.FromTime(now.Add(30 * time.Minute)),
maxt: timestamp.FromTime(now.Add(1 * time.Hour)),
samplesPerSeries: 90,
},
{
series: []labels.Labels{labels.FromStrings("a", "1", "b", "2")},
extLset: labels.FromStrings("ext1", "value1", "replica", "2"),
mint: timestamp.FromTime(now),
maxt: timestamp.FromTime(now.Add(2 * time.Hour)),
samplesPerSeries: 120,
samplesPerSeries: 59,
},
},
replicaLabels: []string{"replica"},
Expand All @@ -217,7 +182,7 @@ func TestCompact(t *testing.T) {
},
expectOfModBlocks: 2,
expectOfBlocks: 1,
expectOfSamples: 210, // TODO(kakkoyun): ?
expectOfSamples: 119,
expectOfSeries: 1,
expectOfChunks: 2,
},
Expand All @@ -229,14 +194,14 @@ func TestCompact(t *testing.T) {
extLset: labels.FromStrings("ext1", "value1", "replica", "1"),
mint: timestamp.FromTime(now.Add(30 * time.Minute)),
maxt: timestamp.FromTime(now.Add(150 * time.Minute)),
samplesPerSeries: 120,
samplesPerSeries: 119,
},
{
series: []labels.Labels{labels.FromStrings("a", "1", "b", "2")},
extLset: labels.FromStrings("ext1", "value1", "replica", "2"),
mint: timestamp.FromTime(now.Add(-30 * time.Minute)),
maxt: timestamp.FromTime(now.Add(90 * time.Minute)),
samplesPerSeries: 120,
mint: timestamp.FromTime(now),
maxt: timestamp.FromTime(now.Add(120 * time.Minute)),
samplesPerSeries: 119,
},
},
replicaLabels: []string{"replica"},
Expand All @@ -252,7 +217,7 @@ func TestCompact(t *testing.T) {
},
expectOfModBlocks: 2,
expectOfBlocks: 1,
expectOfSamples: 240, // TODO(kakkoyun): ?
expectOfSamples: 149,
expectOfSeries: 1,
expectOfChunks: 2,
},
Expand Down

0 comments on commit cbd3ca1

Please sign in to comment.