From c463b0c8c879e985fc5e2df9db3887fa96199c28 Mon Sep 17 00:00:00 2001 From: Goutham Veeramachaneni Date: Fri, 25 Aug 2017 19:36:24 +0530 Subject: [PATCH] Expose NewMergedSeriesSet for merging SeriesSets Signed-off-by: Goutham Veeramachaneni --- querier.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/querier.go b/querier.go index 8f61a3b19..32fdd664d 100644 --- a/querier.go +++ b/querier.go @@ -360,6 +360,13 @@ type mergedSeriesSet struct { adone, bdone bool } +// NewMergedSeriesSet takes two series sets as a single series set. The input series sets +// must be sorted and sequential in time, i.e. if they have the same label set, +// the datapoints of a must be before the datapoints of b. +func NewMergedSeriesSet(a, b SeriesSet) SeriesSet { + return newMergedSeriesSet(a, b) +} + func newMergedSeriesSet(a, b SeriesSet) *mergedSeriesSet { s := &mergedSeriesSet{a: a, b: b} // Initialize first elements of both sets as Next() needs