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{}
|
|
|
|
}
|
|
|
|
|
2020-06-09 09:57:31 -07:00
|
|
|
func (noopQuerier) Select(bool, *SelectHints, ...*labels.Matcher) SeriesSet {
|
|
|
|
return NoopSeriesSet()
|
2020-01-17 03:21:44 -08:00
|
|
|
}
|
|
|
|
|
2020-03-24 13:15:47 -07:00
|
|
|
func (noopQuerier) LabelValues(string) ([]string, Warnings, error) {
|
2019-06-17 00:31:17 -07:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2020-03-24 13:15:47 -07:00
|
|
|
type noopChunkQuerier struct{}
|
|
|
|
|
|
|
|
// NoopChunkedQuerier is a ChunkQuerier that does nothing.
|
|
|
|
func NoopChunkedQuerier() ChunkQuerier {
|
|
|
|
return noopChunkQuerier{}
|
|
|
|
}
|
|
|
|
|
2020-06-09 09:57:31 -07:00
|
|
|
func (noopChunkQuerier) Select(bool, *SelectHints, ...*labels.Matcher) ChunkSeriesSet {
|
|
|
|
return NoopChunkedSeriesSet()
|
2020-03-24 13:15:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
func (noopChunkQuerier) LabelValues(string) ([]string, Warnings, error) {
|
|
|
|
return nil, nil, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (noopChunkQuerier) LabelNames() ([]string, Warnings, error) {
|
|
|
|
return nil, nil, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (noopChunkQuerier) Close() error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2017-10-27 04:29:05 -07:00
|
|
|
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 }
|
2020-03-24 13:15:47 -07:00
|
|
|
|
2020-06-09 09:57:31 -07:00
|
|
|
func (noopSeriesSet) Warnings() Warnings { return nil }
|
|
|
|
|
2020-03-24 13:15:47 -07:00
|
|
|
type noopChunkedSeriesSet struct{}
|
|
|
|
|
|
|
|
// NoopChunkedSeriesSet is a ChunkSeriesSet that does nothing.
|
|
|
|
func NoopChunkedSeriesSet() ChunkSeriesSet {
|
|
|
|
return noopChunkedSeriesSet{}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (noopChunkedSeriesSet) Next() bool { return false }
|
|
|
|
|
|
|
|
func (noopChunkedSeriesSet) At() ChunkSeries { return nil }
|
|
|
|
|
|
|
|
func (noopChunkedSeriesSet) Err() error { return nil }
|
2020-06-09 09:57:31 -07:00
|
|
|
|
|
|
|
func (noopChunkedSeriesSet) Warnings() Warnings { return nil }
|