2017-10-27 04:29:05 -07:00
|
|
|
// Copyright 2017 The Prometheus Authors
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
package storage
|
|
|
|
|
2018-07-17 21:10:28 -07:00
|
|
|
import (
|
|
|
|
"github.com/prometheus/prometheus/pkg/labels"
|
|
|
|
)
|
2017-10-27 04:29:05 -07:00
|
|
|
|
|
|
|
type noopQuerier struct{}
|
|
|
|
|
|
|
|
// NoopQuerier is a Querier that does nothing.
|
|
|
|
func NoopQuerier() Querier {
|
|
|
|
return noopQuerier{}
|
|
|
|
}
|
|
|
|
|
2019-01-02 03:10:13 -08:00
|
|
|
func (noopQuerier) Select(*SelectParams, ...*labels.Matcher) (SeriesSet, Warnings, error) {
|
2018-11-30 06:27:12 -08:00
|
|
|
return NoopSeriesSet(), nil, nil
|
2017-10-27 04:29:05 -07:00
|
|
|
}
|
|
|
|
|
2020-01-17 03:21:44 -08:00
|
|
|
func (noopQuerier) SelectSorted(*SelectParams, ...*labels.Matcher) (SeriesSet, Warnings, error) {
|
|
|
|
return NoopSeriesSet(), nil, nil
|
|
|
|
}
|
|
|
|
|
2019-06-17 00:31:17 -07:00
|
|
|
func (noopQuerier) LabelValues(name string) ([]string, Warnings, error) {
|
|
|
|
return nil, nil, nil
|
2017-10-27 04:29:05 -07:00
|
|
|
}
|
|
|
|
|
2019-06-17 00:31:17 -07:00
|
|
|
func (noopQuerier) LabelNames() ([]string, Warnings, error) {
|
|
|
|
return nil, nil, nil
|
2018-11-19 02:21:14 -08:00
|
|
|
}
|
|
|
|
|
2017-10-27 04:29:05 -07:00
|
|
|
func (noopQuerier) Close() error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type noopSeriesSet struct{}
|
|
|
|
|
|
|
|
// NoopSeriesSet is a SeriesSet that does nothing.
|
|
|
|
func NoopSeriesSet() SeriesSet {
|
|
|
|
return noopSeriesSet{}
|
|
|
|
}
|
|
|
|
|
2020-02-11 08:34:09 -08:00
|
|
|
func (noopSeriesSet) Next() bool { return false }
|
2018-07-17 21:10:28 -07:00
|
|
|
|
2020-02-11 08:34:09 -08:00
|
|
|
func (noopSeriesSet) At() Series { return nil }
|
2018-07-17 21:10:28 -07:00
|
|
|
|
2020-02-11 08:34:09 -08:00
|
|
|
func (noopSeriesSet) Err() error { return nil }
|