func (w *Wrapper) Start() error {
	return nil
}
Start runs the various maintenance loops in goroutines. Returns when the
storage is ready to use. Keeps everything running in the background
until Stop is called.
package querier
import (
	"errors"
	"fmt"
	"time"
	"golang.org/x/net/context"
	"github.com/digitalocean/vulcan/convert"
	"github.com/prometheus/client_golang/prometheus"
	"github.com/prometheus/common/model"
	"github.com/prometheus/prometheus/storage/local"
	"github.com/prometheus/prometheus/storage/metric"
)
const (
	metricNameKey model.LabelName = "__name__"
)
var (
	errNotImplemented = errors.New("not implemented")
)
type IteratorFactory interface {
	Iterator(m metric.Metric, from, through model.Time) (local.SeriesIterator, error)
}
type Wrapper struct {
	prometheus.Collector
	f IteratorFactory
	r Resolver
	queryDurations *prometheus.SummaryVec
	matchesFound   prometheus.Summary
}
type WrapperConfig struct {
	IteratorFactory IteratorFactory
	Resolver        Resolver
}
func NewWrapper(config *WrapperConfig) (*Wrapper, error) {
	w := &Wrapper{
		r: config.Resolver,
		f: config.IteratorFactory,
		matchesFound: prometheus.NewSummary(
			prometheus.SummaryOpts{
				Namespace:  "vulcan",
				Subsystem:  "storage",
				Name:       "number_matches_found",
				Help:       "the number of metrics matched by a query",
				Objectives: map[float64]float64{0.01: 0.001, 0.1: 0.01, 0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
			},
		),
		queryDurations: prometheus.NewSummaryVec(
			prometheus.SummaryOpts{
				Namespace: "vulcan",
				Subsystem: "querier",
				Name:      "duration_nanoseconds",
				Help:      "Durations of different querier stages",
			},
			[]string{"stage"},
		),
	}
	return w, nil
}
func (w *Wrapper) Append(*model.Sample) error {
	return nil
}
func (w *Wrapper) NeedsThrottling() bool {
	return false
}
func (w *Wrapper) QueryRange(ctx context.Context, from, through model.Time, matchers ...*metric.LabelMatcher) ([]local.SeriesIterator, error) {
	mets, err := w.MetricsForLabelMatchers(ctx, from, through, matchers)
	if err != nil {
		return []local.SeriesIterator{}, nil
	}
	itrs := make([]local.SeriesIterator, 0, len(mets))
	for _, met := range mets {
		itr, err := w.f.Iterator(met, from, through)
		if err != nil {
			return []local.SeriesIterator{}, err
		}
		itrs = append(itrs, itr)
	}
	return itrs, nil
}
func (w *Wrapper) QueryInstant(ctx context.Context, ts model.Time, stalenessDelta time.Duration, matchers ...*metric.LabelMatcher) ([]local.SeriesIterator, error) {
	return w.QueryRange(ctx, ts.Add(-stalenessDelta), ts.Add(stalenessDelta), matchers...)
}
func (w *Wrapper) MetricsForLabelMatchers(ctx context.Context, from, through model.Time, matcherSets ...metric.LabelMatchers) ([]metric.Metric, error) {
	result := []metric.Metric{}
	defer func() {
		w.matchesFound.Observe(float64(len(result)))
	}()
	m, err := toMatches(matcherSets...)
	if err != nil {
		return result, err
	}
	tsb, err := w.r.Resolve(ctx, m)
	if err != nil {
		return result, err
	}
	return convert.TimeSeriesBatchToMetrics(tsb), nil
}
func (w *Wrapper) LastSampleForLabelMatchers(ctx context.Context, cutoff model.Time, matcherSets ...metric.LabelMatchers) (model.Vector, error) {
	return model.Vector{}, errNotImplemented
}
func (w *Wrapper) LabelValuesForLabelName(ctx context.Context, name model.LabelName) (model.LabelValues, error) {
	vals, err := w.r.Values(ctx, string(name))
	if err != nil {
		return model.LabelValues{}, err
	}
	res := make(model.LabelValues, 0, len(vals))
	for _, val := range vals {
		res = append(res, model.LabelValue(val))
	}
	return res, nil
}
func (w *Wrapper) DropMetricsForLabelMatchers(...*metric.LabelMatcher) (int, error) {
	return 0, errNotImplemented
}