github.com/grafana/pyroscope@v1.18.0/pkg/phlaredb/tsdb/index/test_utils.go (about) 1 package index 2 3 import ( 4 phlaremodel "github.com/grafana/pyroscope/pkg/model" 5 ) 6 7 type IndexWriterSeries struct { 8 Labels phlaremodel.Labels 9 Chunks []ChunkMeta // series file offset of chunks 10 } 11 12 type IndexWriterSeriesSlice []*IndexWriterSeries 13 14 func (s IndexWriterSeriesSlice) Len() int { return len(s) } 15 func (s IndexWriterSeriesSlice) Swap(i, j int) { s[i], s[j] = s[j], s[i] } 16 17 func (s IndexWriterSeriesSlice) Less(i, j int) bool { 18 return phlaremodel.CompareLabelPairs(s[i].Labels, s[j].Labels) < 0 19 }