From abc2adb1f844af4d7384e78b91711df8e32362ee Mon Sep 17 00:00:00 2001 From: "zhenshan.cao" Date: Sat, 10 Dec 2022 23:45:20 +0800 Subject: [PATCH] Add indexCountLabel for metric QueryNodeNumEntities (#21081) Signed-off-by: zhenshan.cao Signed-off-by: zhenshan.cao --- internal/metrics/querynode_metrics.go | 1 + internal/querynode/meta_replica.go | 2 ++ internal/querynode/segment.go | 1 + 3 files changed, 4 insertions(+) diff --git a/internal/metrics/querynode_metrics.go b/internal/metrics/querynode_metrics.go index dd2cbbd7f..3f863f4bb 100644 --- a/internal/metrics/querynode_metrics.go +++ b/internal/metrics/querynode_metrics.go @@ -323,6 +323,7 @@ var ( collectionIDLabelName, partitionIDLabelName, segmentStateLabelName, + indexCountLabelName, }) // QueryNodeConsumeCounter counts the bytes QueryNode consumed from message storage. diff --git a/internal/querynode/meta_replica.go b/internal/querynode/meta_replica.go index b477aab59..72c22b2e0 100644 --- a/internal/querynode/meta_replica.go +++ b/internal/querynode/meta_replica.go @@ -634,6 +634,7 @@ func (replica *metaReplica) addSegmentPrivate(segment *Segment) error { fmt.Sprint(segment.collectionID), fmt.Sprint(segment.partitionID), segType.String(), + fmt.Sprint(segment.indexedFieldInfos.Len()), ).Add(float64(rowCount)) } return nil @@ -742,6 +743,7 @@ func (replica *metaReplica) removeSegmentPrivate(segmentID UniqueID, segType seg fmt.Sprint(segment.collectionID), fmt.Sprint(segment.partitionID), segType.String(), + fmt.Sprint(segment.indexedFieldInfos.Len()), ).Sub(float64(rowCount)) } } diff --git a/internal/querynode/segment.go b/internal/querynode/segment.go index 61ab65484..b9b370684 100644 --- a/internal/querynode/segment.go +++ b/internal/querynode/segment.go @@ -713,6 +713,7 @@ func (s *Segment) segmentInsert(offset int64, entityIDs []UniqueID, timestamps [ fmt.Sprint(s.collectionID), fmt.Sprint(s.partitionID), s.segmentType.String(), + fmt.Sprint(0), ).Add(float64(numOfRow)) s.setRecentlyModified(true) return nil -- GitLab