func (by SampleSorter) Sort(samples []*Sample) {
	s := &sampleSorter{samples: samples, by: by}
	sort.Sort(s)
}
Sort sorts a Sample slice.
package model
import (
	"encoding/json"
	"sort"
	"github.com/prometheus/common/model"
)
type Sample struct {
	TimestampMS int64
	Value       float64
}
type sampleSorter struct {
	samples []*Sample
	by      func(s1, s2 *Sample) bool
}
func (s *sampleSorter) Len() int { return len(s.samples) }
func (s *sampleSorter) Swap(i, j int) {
	s.samples[i], s.samples[j] = s.samples[j], s.samples[i]
}
func (s *sampleSorter) Less(i, j int) bool {
	return s.by(s.samples[i], s.samples[j])
}
type SampleSorter func(s1, s2 *Sample) bool