@ -62,116 +62,116 @@ func TestMergeQuerierWithChainMerger(t *testing.T) {
{
name : "one querier, two series" ,
querierSeries : [ ] [ ] Series { {
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } ) ,
} } ,
expected : NewMockSeriesSet (
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } ) ,
) ,
} ,
{
name : "two queriers, one different series each" ,
querierSeries : [ ] [ ] Series { {
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } } ) ,
} , {
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } ) ,
} } ,
expected : NewMockSeriesSet (
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } ) ,
) ,
} ,
{
name : "two time unsorted queriers, two series each" ,
querierSeries : [ ] [ ] Series { {
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 5 , 5 , nil , nil } , s ample{ 6 , 6 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 5 , 5 } , fS ample{ 6 , 6 } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } ) ,
} , {
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } , s ample{ 4 , 4 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } , fS ample{ 4 , 4 } } ) ,
} } ,
expected : NewMockSeriesSet (
NewListSeries (
labels . FromStrings ( "bar" , "baz" ) ,
[ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 5 , 5 , nil , nil } , s ample{ 6 , 6 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 5 , 5 } , fS ample{ 6 , 6 } } ,
) ,
NewListSeries (
labels . FromStrings ( "foo" , "bar" ) ,
[ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 4 , 4 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 4 , 4 } } ,
) ,
) ,
} ,
{
name : "five queriers, only two queriers have two time unsorted series each" ,
querierSeries : [ ] [ ] Series { { } , { } , {
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 5 , 5 , nil , nil } , s ample{ 6 , 6 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 5 , 5 } , fS ample{ 6 , 6 } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } ) ,
} , {
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } , s ample{ 4 , 4 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } , fS ample{ 4 , 4 } } ) ,
} , { } } ,
expected : NewMockSeriesSet (
NewListSeries (
labels . FromStrings ( "bar" , "baz" ) ,
[ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 5 , 5 , nil , nil } , s ample{ 6 , 6 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 5 , 5 } , fS ample{ 6 , 6 } } ,
) ,
NewListSeries (
labels . FromStrings ( "foo" , "bar" ) ,
[ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 4 , 4 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 4 , 4 } } ,
) ,
) ,
} ,
{
name : "two queriers, only two queriers have two time unsorted series each, with 3 noop and one nil querier together" ,
querierSeries : [ ] [ ] Series { { } , { } , {
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 5 , 5 , nil , nil } , s ample{ 6 , 6 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 5 , 5 } , fS ample{ 6 , 6 } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } ) ,
} , {
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } , s ample{ 4 , 4 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } , fS ample{ 4 , 4 } } ) ,
} , { } } ,
extraQueriers : [ ] Querier { NoopQuerier ( ) , NoopQuerier ( ) , nil , NoopQuerier ( ) } ,
expected : NewMockSeriesSet (
NewListSeries (
labels . FromStrings ( "bar" , "baz" ) ,
[ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 5 , 5 , nil , nil } , s ample{ 6 , 6 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 5 , 5 } , fS ample{ 6 , 6 } } ,
) ,
NewListSeries (
labels . FromStrings ( "foo" , "bar" ) ,
[ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 4 , 4 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 4 , 4 } } ,
) ,
) ,
} ,
{
name : "two queriers, with two series, one is overlapping" ,
querierSeries : [ ] [ ] Series { { } , { } , {
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 2 , 21 , nil , nil } , s ample{ 3 , 31 , nil , nil } , s ample{ 5 , 5 , nil , nil } , s ample{ 6 , 6 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 2 , 21 } , fS ample{ 3 , 31 } , fS ample{ 5 , 5 } , fS ample{ 6 , 6 } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } ) ,
} , {
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 22 , nil , nil } , s ample{ 3 , 32 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } , s ample{ 4 , 4 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 22 } , fS ample{ 3 , 32 } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } , fS ample{ 4 , 4 } } ) ,
} , { } } ,
expected : NewMockSeriesSet (
NewListSeries (
labels . FromStrings ( "bar" , "baz" ) ,
[ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 21 , nil , nil } , s ample{ 3 , 31 , nil , nil } , s ample{ 5 , 5 , nil , nil } , s ample{ 6 , 6 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 21 } , fS ample{ 3 , 31 } , fS ample{ 5 , 5 } , fS ample{ 6 , 6 } } ,
) ,
NewListSeries (
labels . FromStrings ( "foo" , "bar" ) ,
[ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 4 , 4 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 4 , 4 } } ,
) ,
) ,
} ,
{
name : "two queries, one with NaN samples series" ,
querierSeries : [ ] [ ] Series { {
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 0 , math . NaN ( ) , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 0 , math . NaN ( ) } } ) ,
} , {
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } } ) ,
} } ,
expected : NewMockSeriesSet (
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 0 , math . NaN ( ) , nil , nil } , s ample{ 1 , 1 , nil , nil } } ) ,
NewListSeries ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 0 , math . NaN ( ) } , fS ample{ 1 , 1 } } ) ,
) ,
} ,
} {
@ -245,108 +245,108 @@ func TestMergeChunkQuerierWithNoVerticalChunkSeriesMerger(t *testing.T) {
{
name : "one querier, two series" ,
chkQuerierSeries : [ ] [ ] ChunkSeries { {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 2 , 2 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } } , [ ] tsdbutil . Sample { fS ample{ 2 , 2 } } ) ,
} } ,
expected : NewMockChunkSeriesSet (
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 2 , 2 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } } , [ ] tsdbutil . Sample { fS ample{ 2 , 2 } } ) ,
) ,
} ,
{
name : "two secondaries, one different series each" ,
chkQuerierSeries : [ ] [ ] ChunkSeries { {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } } ) ,
} , {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 2 , 2 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } } , [ ] tsdbutil . Sample { fS ample{ 2 , 2 } } ) ,
} } ,
expected : NewMockChunkSeriesSet (
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 2 , 2 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } } , [ ] tsdbutil . Sample { fS ample{ 2 , 2 } } ) ,
) ,
} ,
{
name : "two secondaries, two not in time order series each" ,
chkQuerierSeries : [ ] [ ] ChunkSeries { {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 5 , 5 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 6 , 6 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 2 , 2 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 5 , 5 } } , [ ] tsdbutil . Sample { fS ample{ 6 , 6 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } } , [ ] tsdbutil . Sample { fS ample{ 2 , 2 } } ) ,
} , {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 4 , 4 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } } , [ ] tsdbutil . Sample { fS ample{ 4 , 4 } } ) ,
} } ,
expected : NewMockChunkSeriesSet (
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) ,
[ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 5 , 5 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 6 , 6 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } ,
[ ] tsdbutil . Sample { fS ample{ 3 , 3 } } ,
[ ] tsdbutil . Sample { fS ample{ 5 , 5 } } ,
[ ] tsdbutil . Sample { fS ample{ 6 , 6 } } ,
) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) ,
[ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 2 , 2 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 4 , 4 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } } ,
[ ] tsdbutil . Sample { fS ample{ 2 , 2 } } ,
[ ] tsdbutil . Sample { fS ample{ 3 , 3 } } ,
[ ] tsdbutil . Sample { fS ample{ 4 , 4 } } ,
) ,
) ,
} ,
{
name : "five secondaries, only two have two not in time order series each" ,
chkQuerierSeries : [ ] [ ] ChunkSeries { { } , { } , {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 5 , 5 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 6 , 6 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 2 , 2 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 5 , 5 } } , [ ] tsdbutil . Sample { fS ample{ 6 , 6 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } } , [ ] tsdbutil . Sample { fS ample{ 2 , 2 } } ) ,
} , {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 4 , 4 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } } , [ ] tsdbutil . Sample { fS ample{ 4 , 4 } } ) ,
} , { } } ,
expected : NewMockChunkSeriesSet (
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) ,
[ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 5 , 5 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 6 , 6 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } ,
[ ] tsdbutil . Sample { fS ample{ 3 , 3 } } ,
[ ] tsdbutil . Sample { fS ample{ 5 , 5 } } ,
[ ] tsdbutil . Sample { fS ample{ 6 , 6 } } ,
) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) ,
[ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 2 , 2 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 4 , 4 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } } ,
[ ] tsdbutil . Sample { fS ample{ 2 , 2 } } ,
[ ] tsdbutil . Sample { fS ample{ 3 , 3 } } ,
[ ] tsdbutil . Sample { fS ample{ 4 , 4 } } ,
) ,
) ,
} ,
{
name : "two secondaries, with two not in time order series each, with 3 noop queries and one nil together" ,
chkQuerierSeries : [ ] [ ] ChunkSeries { {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 5 , 5 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 6 , 6 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 2 , 2 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 5 , 5 } } , [ ] tsdbutil . Sample { fS ample{ 6 , 6 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } } , [ ] tsdbutil . Sample { fS ample{ 2 , 2 } } ) ,
} , {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 4 , 4 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } } , [ ] tsdbutil . Sample { fS ample{ 4 , 4 } } ) ,
} } ,
extraQueriers : [ ] ChunkQuerier { NoopChunkedQuerier ( ) , NoopChunkedQuerier ( ) , nil , NoopChunkedQuerier ( ) } ,
expected : NewMockChunkSeriesSet (
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) ,
[ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 5 , 5 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 6 , 6 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } ,
[ ] tsdbutil . Sample { fS ample{ 3 , 3 } } ,
[ ] tsdbutil . Sample { fS ample{ 5 , 5 } } ,
[ ] tsdbutil . Sample { fS ample{ 6 , 6 } } ,
) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) ,
[ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 2 , 2 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 4 , 4 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } } ,
[ ] tsdbutil . Sample { fS ample{ 2 , 2 } } ,
[ ] tsdbutil . Sample { fS ample{ 3 , 3 } } ,
[ ] tsdbutil . Sample { fS ample{ 4 , 4 } } ,
) ,
) ,
} ,
{
name : "two queries, one with NaN samples series" ,
chkQuerierSeries : [ ] [ ] ChunkSeries { {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 0 , math . NaN ( ) , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 0 , math . NaN ( ) } } ) ,
} , {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } } ) ,
} } ,
expected : NewMockChunkSeriesSet (
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { s ample{ 0 , math . NaN ( ) , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "foo" , "bar" ) , [ ] tsdbutil . Sample { fS ample{ 0 , math . NaN ( ) } } , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } } ) ,
) ,
} ,
} {
@ -385,12 +385,12 @@ func TestCompactingChunkSeriesMerger(t *testing.T) {
m := NewCompactingChunkSeriesMerger ( ChainedSeriesMerge )
// histogramSample returns a histogram that is unique to the ts.
histogramSample := func ( ts int64 ) s ample {
return s ample{ t : ts , h : tsdbutil . GenerateTestHistogram ( int ( ts + 1 ) ) }
histogramSample := func ( ts int64 ) hS ample {
return hS ample{ t : ts , h : tsdbutil . GenerateTestHistogram ( int ( ts + 1 ) ) }
}
floatHistogramSample := func ( ts int64 ) s ample {
return s ample{ t : ts , fh : tsdbutil . GenerateTestFloatHistogram ( int ( ts + 1 ) ) }
floatHistogramSample := func ( ts int64 ) fhS ample {
return fhS ample{ t : ts , fh : tsdbutil . GenerateTestFloatHistogram ( int ( ts + 1 ) ) }
}
for _ , tc := range [ ] struct {
@ -408,9 +408,9 @@ func TestCompactingChunkSeriesMerger(t *testing.T) {
{
name : "single series" ,
input : [ ] ChunkSeries {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } } ) ,
} ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } } ) ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } } ) ,
} ,
{
name : "two empty series" ,
@ -423,55 +423,55 @@ func TestCompactingChunkSeriesMerger(t *testing.T) {
{
name : "two non overlapping" ,
input : [ ] ChunkSeries {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } , s ample{ 5 , 5 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 7 , 7 , nil , nil } , s ample{ 9 , 9 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 10 , 10 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } , fS ample{ 5 , 5 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 7 , 7 } , fS ample{ 9 , 9 } } , [ ] tsdbutil . Sample { fS ample{ 10 , 10 } } ) ,
} ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } , s ample{ 5 , 5 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 7 , 7 , nil , nil } , s ample{ 9 , 9 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 10 , 10 , nil , nil } } ) ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } , fS ample{ 5 , 5 } } , [ ] tsdbutil . Sample { fS ample{ 7 , 7 } , fS ample{ 9 , 9 } } , [ ] tsdbutil . Sample { fS ample{ 10 , 10 } } ) ,
} ,
{
name : "two overlapping" ,
input : [ ] ChunkSeries {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } , s ample{ 8 , 8 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 7 , 7 , nil , nil } , s ample{ 9 , 9 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 10 , 10 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } , fS ample{ 8 , 8 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 7 , 7 } , fS ample{ 9 , 9 } } , [ ] tsdbutil . Sample { fS ample{ 10 , 10 } } ) ,
} ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } , s ample{ 7 , 7 , nil , nil } , s ample{ 8 , 8 , nil , nil } , s ample{ 9 , 9 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 10 , 10 , nil , nil } } ) ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } , fS ample{ 7 , 7 } , fS ample{ 8 , 8 } , fS ample{ 9 , 9 } } , [ ] tsdbutil . Sample { fS ample{ 10 , 10 } } ) ,
} ,
{
name : "two duplicated" ,
input : [ ] ChunkSeries {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 5 , 5 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 5 , 5 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 5 , 5 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 5 , 5 } } ) ,
} ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 5 , 5 , nil , nil } } ) ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 5 , 5 } } ) ,
} ,
{
name : "three overlapping" ,
input : [ ] ChunkSeries {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 5 , 5 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 6 , 6 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 4 , 4 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 5 , 5 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 6 , 6 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 4 , 4 } } ) ,
} ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 4 , 4 , nil , nil } , s ample{ 5 , 5 , nil , nil } , s ample{ 6 , 6 , nil , nil } } ) ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 4 , 4 } , fS ample{ 5 , 5 } , fS ample{ 6 , 6 } } ) ,
} ,
{
name : "three in chained overlap" ,
input : [ ] ChunkSeries {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 5 , 5 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 4 , 4 , nil , nil } , s ample{ 6 , 66 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 6 , 6 , nil , nil } , s ample{ 10 , 10 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 5 , 5 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 4 , 4 } , fS ample{ 6 , 66 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 6 , 6 } , fS ample{ 10 , 10 } } ) ,
} ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 4 , 4 , nil , nil } , s ample{ 5 , 5 , nil , nil } , s ample{ 6 , 66 , nil , nil } , s ample{ 10 , 10 , nil , nil } } ) ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 4 , 4 } , fS ample{ 5 , 5 } , fS ample{ 6 , 66 } , fS ample{ 10 , 10 } } ) ,
} ,
{
name : "three in chained overlap complex" ,
input : [ ] ChunkSeries {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 5 , 5 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 10 , 10 , nil , nil } , s ample{ 15 , 15 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 2 , 2 , nil , nil } , s ample{ 20 , 20 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 25 , 25 , nil , nil } , s ample{ 30 , 30 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 18 , 18 , nil , nil } , s ample{ 26 , 26 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 31 , 31 , nil , nil } , s ample{ 35 , 35 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 5 , 5 } } , [ ] tsdbutil . Sample { fS ample{ 10 , 10 } , fS ample{ 15 , 15 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 2 , 2 } , fS ample{ 20 , 20 } } , [ ] tsdbutil . Sample { fS ample{ 25 , 25 } , fS ample{ 30 , 30 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 18 , 18 } , fS ample{ 26 , 26 } } , [ ] tsdbutil . Sample { fS ample{ 31 , 31 } , fS ample{ 35 , 35 } } ) ,
} ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) ,
[ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 5 , 5 , nil , nil } , s ample{ 10 , 10 , nil , nil } , s ample{ 15 , 15 , nil , nil } , s ample{ 18 , 18 , nil , nil } , s ample{ 20 , 20 , nil , nil } , s ample{ 25 , 25 , nil , nil } , s ample{ 26 , 26 , nil , nil } , s ample{ 30 , 30 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 31 , 31 , nil , nil } , s ample{ 35 , 35 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 2 , 2 } , fS ample{ 5 , 5 } , fS ample{ 10 , 10 } , fS ample{ 15 , 15 } , fS ample{ 18 , 18 } , fS ample{ 20 , 20 } , fS ample{ 25 , 25 } , fS ample{ 26 , 26 } , fS ample{ 30 , 30 } } ,
[ ] tsdbutil . Sample { fS ample{ 31 , 31 } , fS ample{ 35 , 35 } } ,
) ,
} ,
{
@ -511,13 +511,13 @@ func TestCompactingChunkSeriesMerger(t *testing.T) {
name : "histogram chunks overlapping with float chunks" ,
input : [ ] ChunkSeries {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { histogramSample ( 0 ) , histogramSample ( 5 ) } , [ ] tsdbutil . Sample { histogramSample ( 10 ) , histogramSample ( 15 ) } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 12 , 12 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 14 , 14 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 12 , 12 } } , [ ] tsdbutil . Sample { fS ample{ 14 , 14 } } ) ,
} ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) ,
[ ] tsdbutil . Sample { histogramSample ( 0 ) } ,
[ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 1 , 1 } } ,
[ ] tsdbutil . Sample { histogramSample ( 5 ) , histogramSample ( 10 ) } ,
[ ] tsdbutil . Sample { s ample{ 12 , 12 , nil , nil } , s ample{ 14 , 14 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 12 , 12 } , fS ample{ 14 , 14 } } ,
[ ] tsdbutil . Sample { histogramSample ( 15 ) } ,
) ,
} ,
@ -537,13 +537,13 @@ func TestCompactingChunkSeriesMerger(t *testing.T) {
name : "float histogram chunks overlapping with float chunks" ,
input : [ ] ChunkSeries {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { floatHistogramSample ( 0 ) , floatHistogramSample ( 5 ) } , [ ] tsdbutil . Sample { floatHistogramSample ( 10 ) , floatHistogramSample ( 15 ) } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 12 , 12 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 14 , 14 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 12 , 12 } } , [ ] tsdbutil . Sample { fS ample{ 14 , 14 } } ) ,
} ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) ,
[ ] tsdbutil . Sample { floatHistogramSample ( 0 ) } ,
[ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 1 , 1 } } ,
[ ] tsdbutil . Sample { floatHistogramSample ( 5 ) , floatHistogramSample ( 10 ) } ,
[ ] tsdbutil . Sample { s ample{ 12 , 12 , nil , nil } , s ample{ 14 , 14 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 12 , 12 } , fS ample{ 14 , 14 } } ,
[ ] tsdbutil . Sample { floatHistogramSample ( 15 ) } ,
) ,
} ,
@ -592,9 +592,9 @@ func TestConcatenatingChunkSeriesMerger(t *testing.T) {
{
name : "single series" ,
input : [ ] ChunkSeries {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } } ) ,
} ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } } ) ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } } ) ,
} ,
{
name : "two empty series" ,
@ -607,70 +607,70 @@ func TestConcatenatingChunkSeriesMerger(t *testing.T) {
{
name : "two non overlapping" ,
input : [ ] ChunkSeries {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } , s ample{ 5 , 5 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 7 , 7 , nil , nil } , s ample{ 9 , 9 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 10 , 10 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } , fS ample{ 5 , 5 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 7 , 7 } , fS ample{ 9 , 9 } } , [ ] tsdbutil . Sample { fS ample{ 10 , 10 } } ) ,
} ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } , s ample{ 5 , 5 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 7 , 7 , nil , nil } , s ample{ 9 , 9 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 10 , 10 , nil , nil } } ) ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } , fS ample{ 5 , 5 } } , [ ] tsdbutil . Sample { fS ample{ 7 , 7 } , fS ample{ 9 , 9 } } , [ ] tsdbutil . Sample { fS ample{ 10 , 10 } } ) ,
} ,
{
name : "two overlapping" ,
input : [ ] ChunkSeries {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } , s ample{ 8 , 8 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 7 , 7 , nil , nil } , s ample{ 9 , 9 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 10 , 10 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } , fS ample{ 8 , 8 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 7 , 7 } , fS ample{ 9 , 9 } } , [ ] tsdbutil . Sample { fS ample{ 10 , 10 } } ) ,
} ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) ,
[ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 3 , 3 , nil , nil } , s ample{ 8 , 8 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 7 , 7 , nil , nil } , s ample{ 9 , 9 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 10 , 10 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } , [ ] tsdbutil . Sample { fS ample{ 3 , 3 } , fS ample{ 8 , 8 } } ,
[ ] tsdbutil . Sample { fS ample{ 7 , 7 } , fS ample{ 9 , 9 } } , [ ] tsdbutil . Sample { fS ample{ 10 , 10 } } ,
) ,
} ,
{
name : "two duplicated" ,
input : [ ] ChunkSeries {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 5 , 5 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 5 , 5 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 5 , 5 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 5 , 5 } } ) ,
} ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) ,
[ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 5 , 5 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 5 , 5 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 5 , 5 } } ,
[ ] tsdbutil . Sample { fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 5 , 5 } } ,
) ,
} ,
{
name : "three overlapping" ,
input : [ ] ChunkSeries {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 5 , 5 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 6 , 6 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 4 , 4 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 5 , 5 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 6 , 6 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 4 , 4 } } ) ,
} ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) ,
[ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 5 , 5 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 6 , 6 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 4 , 4 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 5 , 5 } } ,
[ ] tsdbutil . Sample { fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 6 , 6 } } ,
[ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 4 , 4 } } ,
) ,
} ,
{
name : "three in chained overlap" ,
input : [ ] ChunkSeries {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 5 , 5 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 4 , 4 , nil , nil } , s ample{ 6 , 66 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 6 , 6 , nil , nil } , s ample{ 10 , 10 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 5 , 5 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 4 , 4 } , fS ample{ 6 , 66 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 6 , 6 } , fS ample{ 10 , 10 } } ) ,
} ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) ,
[ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 5 , 5 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 4 , 4 , nil , nil } , s ample{ 6 , 66 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 6 , 6 , nil , nil } , s ample{ 10 , 10 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 5 , 5 } } ,
[ ] tsdbutil . Sample { fS ample{ 4 , 4 } , fS ample{ 6 , 66 } } ,
[ ] tsdbutil . Sample { fS ample{ 6 , 6 } , fS ample{ 10 , 10 } } ,
) ,
} ,
{
name : "three in chained overlap complex" ,
input : [ ] ChunkSeries {
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 5 , 5 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 10 , 10 , nil , nil } , s ample{ 15 , 15 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 2 , 2 , nil , nil } , s ample{ 20 , 20 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 25 , 25 , nil , nil } , s ample{ 30 , 30 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { s ample{ 18 , 18 , nil , nil } , s ample{ 26 , 26 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 31 , 31 , nil , nil } , s ample{ 35 , 35 , nil , nil } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 5 , 5 } } , [ ] tsdbutil . Sample { fS ample{ 10 , 10 } , fS ample{ 15 , 15 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 2 , 2 } , fS ample{ 20 , 20 } } , [ ] tsdbutil . Sample { fS ample{ 25 , 25 } , fS ample{ 30 , 30 } } ) ,
NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) , [ ] tsdbutil . Sample { fS ample{ 18 , 18 } , fS ample{ 26 , 26 } } , [ ] tsdbutil . Sample { fS ample{ 31 , 31 } , fS ample{ 35 , 35 } } ) ,
} ,
expected : NewListChunkSeriesFromSamples ( labels . FromStrings ( "bar" , "baz" ) ,
[ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 5 , 5 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 10 , 10 , nil , nil } , s ample{ 15 , 15 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 2 , 2 , nil , nil } , s ample{ 20 , 20 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 25 , 25 , nil , nil } , s ample{ 30 , 30 , nil , nil } } ,
[ ] tsdbutil . Sample { s ample{ 18 , 18 , nil , nil } , s ample{ 26 , 26 , nil , nil } } , [ ] tsdbutil . Sample { s ample{ 31 , 31 , nil , nil } , s ample{ 35 , 35 , nil , nil } } ,
[ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 5 , 5 } } , [ ] tsdbutil . Sample { fS ample{ 10 , 10 } , fS ample{ 15 , 15 } } ,
[ ] tsdbutil . Sample { fS ample{ 2 , 2 } , fS ample{ 20 , 20 } } , [ ] tsdbutil . Sample { fS ample{ 25 , 25 } , fS ample{ 30 , 30 } } ,
[ ] tsdbutil . Sample { fS ample{ 18 , 18 } , fS ample{ 26 , 26 } } , [ ] tsdbutil . Sample { fS ample{ 31 , 31 } , fS ample{ 35 , 35 } } ,
) ,
} ,
{
@ -807,38 +807,38 @@ func TestChainSampleIterator(t *testing.T) {
} {
{
input : [ ] chunkenc . Iterator {
NewListSeriesIterator ( samples { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } } ) ,
NewListSeriesIterator ( samples { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } } ) ,
} ,
expected : [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } } ,
expected : [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } } ,
} ,
{
input : [ ] chunkenc . Iterator {
NewListSeriesIterator ( samples { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } } ) ,
NewListSeriesIterator ( samples { s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } } ) ,
NewListSeriesIterator ( samples { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } } ) ,
NewListSeriesIterator ( samples { fS ample{ 2 , 2 } , fS ample{ 3 , 3 } } ) ,
} ,
expected : [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } } ,
expected : [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } } ,
} ,
{
input : [ ] chunkenc . Iterator {
NewListSeriesIterator ( samples { s ample{ 0 , 0 , nil , nil } , s ample{ 3 , 3 , nil , nil } } ) ,
NewListSeriesIterator ( samples { s ample{ 1 , 1 , nil , nil } , s ample{ 4 , 4 , nil , nil } } ) ,
NewListSeriesIterator ( samples { s ample{ 2 , 2 , nil , nil } , s ample{ 5 , 5 , nil , nil } } ) ,
NewListSeriesIterator ( samples { fS ample{ 0 , 0 } , fS ample{ 3 , 3 } } ) ,
NewListSeriesIterator ( samples { fS ample{ 1 , 1 } , fS ample{ 4 , 4 } } ) ,
NewListSeriesIterator ( samples { fS ample{ 2 , 2 } , fS ample{ 5 , 5 } } ) ,
} ,
expected : [ ] tsdbutil . Sample {
s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 4 , 4 , nil , nil } , s ample{ 5 , 5 , nil , nil } ,
fS ample{ 0 , 0 } , fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 4 , 4 } , fS ample{ 5 , 5 } ,
} ,
} ,
// Overlap.
{
input : [ ] chunkenc . Iterator {
NewListSeriesIterator ( samples { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } } ) ,
NewListSeriesIterator ( samples { s ample{ 0 , 0 , nil , nil } , s ample{ 2 , 2 , nil , nil } } ) ,
NewListSeriesIterator ( samples { s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } } ) ,
NewListSeriesIterator ( samples { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } } ) ,
NewListSeriesIterator ( samples { fS ample{ 0 , 0 } , fS ample{ 2 , 2 } } ) ,
NewListSeriesIterator ( samples { fS ample{ 2 , 2 } , fS ample{ 3 , 3 } } ) ,
NewListSeriesIterator ( samples { } ) ,
NewListSeriesIterator ( samples { } ) ,
NewListSeriesIterator ( samples { } ) ,
} ,
expected : [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } } ,
expected : [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } } ,
} ,
} {
merged := ChainSampleIteratorFromIterators ( nil , tc . input )
@ -856,42 +856,42 @@ func TestChainSampleIteratorSeek(t *testing.T) {
} {
{
input : [ ] chunkenc . Iterator {
NewListSeriesIterator ( samples { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } ) ,
NewListSeriesIterator ( samples { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } ) ,
} ,
seek : 1 ,
expected : [ ] tsdbutil . Sample { s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } ,
expected : [ ] tsdbutil . Sample { fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } ,
} ,
{
input : [ ] chunkenc . Iterator {
NewListSeriesIterator ( samples { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } } ) ,
NewListSeriesIterator ( samples { s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } } ) ,
NewListSeriesIterator ( samples { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } } ) ,
NewListSeriesIterator ( samples { fS ample{ 2 , 2 } , fS ample{ 3 , 3 } } ) ,
} ,
seek : 2 ,
expected : [ ] tsdbutil . Sample { s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } } ,
expected : [ ] tsdbutil . Sample { fS ample{ 2 , 2 } , fS ample{ 3 , 3 } } ,
} ,
{
input : [ ] chunkenc . Iterator {
NewListSeriesIterator ( samples { s ample{ 0 , 0 , nil , nil } , s ample{ 3 , 3 , nil , nil } } ) ,
NewListSeriesIterator ( samples { s ample{ 1 , 1 , nil , nil } , s ample{ 4 , 4 , nil , nil } } ) ,
NewListSeriesIterator ( samples { s ample{ 2 , 2 , nil , nil } , s ample{ 5 , 5 , nil , nil } } ) ,
NewListSeriesIterator ( samples { fS ample{ 0 , 0 } , fS ample{ 3 , 3 } } ) ,
NewListSeriesIterator ( samples { fS ample{ 1 , 1 } , fS ample{ 4 , 4 } } ) ,
NewListSeriesIterator ( samples { fS ample{ 2 , 2 } , fS ample{ 5 , 5 } } ) ,
} ,
seek : 2 ,
expected : [ ] tsdbutil . Sample { s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } , s ample{ 4 , 4 , nil , nil } , s ample{ 5 , 5 , nil , nil } } ,
expected : [ ] tsdbutil . Sample { fS ample{ 2 , 2 } , fS ample{ 3 , 3 } , fS ample{ 4 , 4 } , fS ample{ 5 , 5 } } ,
} ,
{
input : [ ] chunkenc . Iterator {
NewListSeriesIterator ( samples { s ample{ 0 , 0 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } } ) ,
NewListSeriesIterator ( samples { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } } ) ,
NewListSeriesIterator ( samples { fS ample{ 0 , 0 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } } ) ,
NewListSeriesIterator ( samples { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } , fS ample{ 2 , 2 } } ) ,
} ,
seek : 0 ,
expected : [ ] tsdbutil . Sample { s ample{ 0 , 0 , nil , nil } , s ample{ 1 , 1 , nil , nil } , s ample{ 2 , 2 , nil , nil } , s ample{ 3 , 3 , nil , nil } } ,
expected : [ ] tsdbutil . Sample { fS ample{ 0 , 0 } , fS ample{ 1 , 1 } , fS ample{ 2 , 2 } , fS ample{ 3 , 3 } } ,
} ,
} {
merged := ChainSampleIteratorFromIterators ( nil , tc . input )
actual := [ ] tsdbutil . Sample { }
if merged . Seek ( tc . seek ) == chunkenc . ValFloat {
t , v := merged . At ( )
actual = append ( actual , s ample{ t , v , nil , nil } )
t , f := merged . At ( )
actual = append ( actual , fS ample{ t , f } )
}
s , err := ExpandSamples ( merged , nil )
require . NoError ( t , err )
@ -906,7 +906,7 @@ func makeSeries(numSeries, numSamples int) []Series {
labels := labels . FromStrings ( "foo" , fmt . Sprintf ( "bar%d" , j ) )
samples := [ ] tsdbutil . Sample { }
for k := 0 ; k < numSamples ; k ++ {
samples = append ( samples , s ample{ t : int64 ( k ) , v : float64 ( k ) } )
samples = append ( samples , fS ample{ t : int64 ( k ) , f : float64 ( k ) } )
}
series = append ( series , NewListSeries ( labels , samples ) )
}