mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Also, don't make a mergeSeriesSet if there is only one SeriesSet.
This commit is contained in:
parent
48e39068bd
commit
749781edf3
|
@ -303,6 +303,10 @@ type mergeSeriesSet struct {
|
||||||
// NewMergeSeriesSet returns a new series set that merges (deduplicates)
|
// NewMergeSeriesSet returns a new series set that merges (deduplicates)
|
||||||
// series returned by the input series sets when iterating.
|
// series returned by the input series sets when iterating.
|
||||||
func NewMergeSeriesSet(sets []SeriesSet) SeriesSet {
|
func NewMergeSeriesSet(sets []SeriesSet) SeriesSet {
|
||||||
|
if len(sets) == 1 {
|
||||||
|
return sets[0]
|
||||||
|
}
|
||||||
|
|
||||||
// Sets need to be pre-advanced, so we can introspect the label of the
|
// Sets need to be pre-advanced, so we can introspect the label of the
|
||||||
// series under the cursor.
|
// series under the cursor.
|
||||||
var h seriesSetHeap
|
var h seriesSetHeap
|
||||||
|
|
Loading…
Reference in a new issue