| 
									
										
										
										
											2017-10-27 19:29:05 +08: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-18 12:10:28 +08:00
										 |  |  | import ( | 
					
						
							| 
									
										
										
										
											2021-11-08 22:23:17 +08:00
										 |  |  | 	"github.com/prometheus/prometheus/model/labels" | 
					
						
							| 
									
										
										
										
											2018-07-18 12:10:28 +08:00
										 |  |  | ) | 
					
						
							| 
									
										
										
										
											2017-10-27 19:29:05 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | type noopQuerier struct{} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // NoopQuerier is a Querier that does nothing.
 | 
					
						
							|  |  |  | func NoopQuerier() Querier { | 
					
						
							|  |  |  | 	return noopQuerier{} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-10 00:57:31 +08:00
										 |  |  | func (noopQuerier) Select(bool, *SelectHints, ...*labels.Matcher) SeriesSet { | 
					
						
							|  |  |  | 	return NoopSeriesSet() | 
					
						
							| 
									
										
										
										
											2020-01-17 19:21:44 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-10 01:38:35 +08:00
										 |  |  | func (noopQuerier) LabelValues(string, ...*labels.Matcher) ([]string, Warnings, error) { | 
					
						
							| 
									
										
										
										
											2019-06-17 15:31:17 +08:00
										 |  |  | 	return nil, nil, nil | 
					
						
							| 
									
										
										
										
											2017-10-27 19:29:05 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-20 20:38:08 +08:00
										 |  |  | func (noopQuerier) LabelNames(...*labels.Matcher) ([]string, Warnings, error) { | 
					
						
							| 
									
										
										
										
											2019-06-17 15:31:17 +08:00
										 |  |  | 	return nil, nil, nil | 
					
						
							| 
									
										
										
										
											2018-11-19 18:21:14 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-27 19:29:05 +08:00
										 |  |  | func (noopQuerier) Close() error { | 
					
						
							|  |  |  | 	return nil | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-25 04:15:47 +08:00
										 |  |  | type noopChunkQuerier struct{} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // NoopChunkedQuerier is a ChunkQuerier that does nothing.
 | 
					
						
							|  |  |  | func NoopChunkedQuerier() ChunkQuerier { | 
					
						
							|  |  |  | 	return noopChunkQuerier{} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-10 00:57:31 +08:00
										 |  |  | func (noopChunkQuerier) Select(bool, *SelectHints, ...*labels.Matcher) ChunkSeriesSet { | 
					
						
							|  |  |  | 	return NoopChunkedSeriesSet() | 
					
						
							| 
									
										
										
										
											2020-03-25 04:15:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-10 01:38:35 +08:00
										 |  |  | func (noopChunkQuerier) LabelValues(string, ...*labels.Matcher) ([]string, Warnings, error) { | 
					
						
							| 
									
										
										
										
											2020-03-25 04:15:47 +08:00
										 |  |  | 	return nil, nil, nil | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-20 20:38:08 +08:00
										 |  |  | func (noopChunkQuerier) LabelNames(...*labels.Matcher) ([]string, Warnings, error) { | 
					
						
							| 
									
										
										
										
											2020-03-25 04:15:47 +08:00
										 |  |  | 	return nil, nil, nil | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func (noopChunkQuerier) Close() error { | 
					
						
							|  |  |  | 	return nil | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-27 19:29:05 +08:00
										 |  |  | type noopSeriesSet struct{} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // NoopSeriesSet is a SeriesSet that does nothing.
 | 
					
						
							|  |  |  | func NoopSeriesSet() SeriesSet { | 
					
						
							|  |  |  | 	return noopSeriesSet{} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-02-12 00:34:09 +08:00
										 |  |  | func (noopSeriesSet) Next() bool { return false } | 
					
						
							| 
									
										
										
										
											2018-07-18 12:10:28 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-02-12 00:34:09 +08:00
										 |  |  | func (noopSeriesSet) At() Series { return nil } | 
					
						
							| 
									
										
										
										
											2018-07-18 12:10:28 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-02-12 00:34:09 +08:00
										 |  |  | func (noopSeriesSet) Err() error { return nil } | 
					
						
							| 
									
										
										
										
											2020-03-25 04:15:47 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-10 00:57:31 +08:00
										 |  |  | func (noopSeriesSet) Warnings() Warnings { return nil } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-25 04:15:47 +08: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-10 00:57:31 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | func (noopChunkedSeriesSet) Warnings() Warnings { return nil } |