func getSumReader(t *testing.T, values ...int64) export.InstrumentationLibraryReader {
	ctx, meter, cont := testMeter(t)
	counter := metric.Must(meter).NewInt64Counter("metric_sum")
	for _, value := range values {
		counter.Add(ctx, value)
	}
	require.NoError(t, cont.Collect(ctx))
	return cont
}
getSumReader returns a checkpoint set with a sum aggregation record
package cortex
import (
	"context"
	"fmt"
	"strings"
	"testing"
	"time"
	"github.com/prometheus/prometheus/prompb"
	"github.com/stretchr/testify/require"
	"go.opentelemetry.io/otel/metric"
	export "go.opentelemetry.io/otel/sdk/export/metric"
	"go.opentelemetry.io/otel/sdk/metric/aggregator/histogram"
	"go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue"
	"go.opentelemetry.io/otel/sdk/metric/aggregator/minmaxsumcount"
	"go.opentelemetry.io/otel/sdk/metric/aggregator/sum"
	controller "go.opentelemetry.io/otel/sdk/metric/controller/basic"
	processor "go.opentelemetry.io/otel/sdk/metric/processor/basic"
)
type testAggregatorSelector struct {
}
var testHistogramBoundaries = []float64{
	100, 500, 900,
}
func (testAggregatorSelector) AggregatorFor(desc *metric.Descriptor, aggPtrs ...*export.Aggregator) {
	switch {
	case strings.HasSuffix(desc.Name(), "_sum"):
		aggs := sum.New(len(aggPtrs))
		for i := range aggPtrs {
			*aggPtrs[i] = &aggs[i]
		}
	case strings.HasSuffix(desc.Name(), "_mmsc"):
		aggs := minmaxsumcount.New(len(aggPtrs), desc)
		for i := range aggPtrs {
			*aggPtrs[i] = &aggs[i]
		}
	case strings.HasSuffix(desc.Name(), "_lastvalue"):
		aggs := lastvalue.New(len(aggPtrs))
		for i := range aggPtrs {
			*aggPtrs[i] = &aggs[i]
		}
	case strings.HasSuffix(desc.Name(), "_histogram"):
		aggs := histogram.New(len(aggPtrs), desc, histogram.WithExplicitBoundaries(testHistogramBoundaries))
		for i := range aggPtrs {
			*aggPtrs[i] = &aggs[i]
		}
	default:
		panic(fmt.Sprint("Invalid instrument name for test AggregatorSelector: ", desc.Name()))
	}
}
func testMeter(t *testing.T) (context.Context, metric.Meter, *controller.Controller) {
	aggSel := testAggregatorSelector{}
	proc := processor.NewFactory(aggSel, export.CumulativeExportKindSelector())
	cont := controller.New(proc,
		controller.WithResource(testResource),
	)
	ctx := context.Background()
	return ctx, cont.Meter("test"), cont
}