mirror of https://github.com/milvus-io/milvus.git
fix: fix partition loaded num metric (#33316)
issue: https://github.com/milvus-io/milvus/issues/32108 Signed-off-by: sunby <sunbingyi1992@gmail.com>pull/33348/head
parent
3c7d0209d4
commit
370562b4ec
|
@ -36,6 +36,7 @@ import (
|
||||||
"github.com/milvus-io/milvus/internal/proto/datapb"
|
"github.com/milvus-io/milvus/internal/proto/datapb"
|
||||||
"github.com/milvus-io/milvus/internal/proto/querypb"
|
"github.com/milvus-io/milvus/internal/proto/querypb"
|
||||||
"github.com/milvus-io/milvus/internal/querynodev2/segments/metricsutil"
|
"github.com/milvus-io/milvus/internal/querynodev2/segments/metricsutil"
|
||||||
|
"github.com/milvus-io/milvus/pkg/common"
|
||||||
"github.com/milvus-io/milvus/pkg/eventlog"
|
"github.com/milvus-io/milvus/pkg/eventlog"
|
||||||
"github.com/milvus-io/milvus/pkg/log"
|
"github.com/milvus-io/milvus/pkg/log"
|
||||||
"github.com/milvus-io/milvus/pkg/metrics"
|
"github.com/milvus-io/milvus/pkg/metrics"
|
||||||
|
@ -723,12 +724,16 @@ func (mgr *segmentManager) updateMetric() {
|
||||||
collections, partiations := make(typeutil.Set[int64]), make(typeutil.Set[int64])
|
collections, partiations := make(typeutil.Set[int64]), make(typeutil.Set[int64])
|
||||||
for _, seg := range mgr.growingSegments {
|
for _, seg := range mgr.growingSegments {
|
||||||
collections.Insert(seg.Collection())
|
collections.Insert(seg.Collection())
|
||||||
|
if seg.Partition() != common.AllPartitionsID {
|
||||||
partiations.Insert(seg.Partition())
|
partiations.Insert(seg.Partition())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for _, seg := range mgr.sealedSegments {
|
for _, seg := range mgr.sealedSegments {
|
||||||
collections.Insert(seg.Collection())
|
collections.Insert(seg.Collection())
|
||||||
|
if seg.Partition() != common.AllPartitionsID {
|
||||||
partiations.Insert(seg.Partition())
|
partiations.Insert(seg.Partition())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
metrics.QueryNodeNumCollections.WithLabelValues(fmt.Sprint(paramtable.GetNodeID())).Set(float64(collections.Len()))
|
metrics.QueryNodeNumCollections.WithLabelValues(fmt.Sprint(paramtable.GetNodeID())).Set(float64(collections.Len()))
|
||||||
metrics.QueryNodeNumPartitions.WithLabelValues(fmt.Sprint(paramtable.GetNodeID())).Set(float64(partiations.Len()))
|
metrics.QueryNodeNumPartitions.WithLabelValues(fmt.Sprint(paramtable.GetNodeID())).Set(float64(partiations.Len()))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue