From 3f58cf440520771dd86e3aa41fa2e00cb5f1e9ff Mon Sep 17 00:00:00 2001 From: Arve Knudsen Date: Tue, 20 Feb 2024 14:58:30 +0100 Subject: [PATCH] Improve PostingsForMatcher doc string Signed-off-by: Arve Knudsen --- tsdb/block.go | 4 ++-- tsdb/postings_for_matchers_cache.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tsdb/block.go b/tsdb/block.go index 589efea86c..c94cb92e54 100644 --- a/tsdb/block.go +++ b/tsdb/block.go @@ -74,8 +74,8 @@ type IndexReader interface { // LabelValues returns possible label values which may not be sorted. LabelValues(ctx context.Context, name string, matchers ...*labels.Matcher) ([]string, error) - // PostingsForMatcher returns a sorted iterator over postings matching the provided label matcher. - // This method will not return postings for missing labels. + // PostingsForMatcher returns a sorted iterator over postings having a label matching the provided label matcher. + // If no postings are found having a label with the correct name and matching value, an empty iterator is returned. PostingsForMatcher(ctx context.Context, m *labels.Matcher) index.Postings // PostingsForMatchers assembles a single postings iterator based on the given matchers. diff --git a/tsdb/postings_for_matchers_cache.go b/tsdb/postings_for_matchers_cache.go index b6e182975f..591d2cd832 100644 --- a/tsdb/postings_for_matchers_cache.go +++ b/tsdb/postings_for_matchers_cache.go @@ -34,8 +34,8 @@ type IndexPostingsReader interface { // LabelValues returns possible label values which may not be sorted. LabelValues(ctx context.Context, name string, matchers ...*labels.Matcher) ([]string, error) - // PostingsForMatcher returns a sorted iterator over postings matching the provided label matcher. - // This method will not return postings for missing labels. + // PostingsForMatcher returns a sorted iterator over postings having a label matching the provided label matcher. + // If no postings are found having a label with the correct name and matching value, an empty iterator is returned. PostingsForMatcher(ctx context.Context, m *labels.Matcher) index.Postings }