mirror of https://github.com/milvus-io/milvus.git
fix: fix loaded entity num is inaccurate (#33522)
issue: #33520 Signed-off-by: jaime <yun.zhang@zilliz.com>pull/33597/head^2
parent
44e97b7cda
commit
0ad55c6c44
|
@ -103,11 +103,12 @@ func getQuotaMetrics(node *QueryNode) (*metricsinfo.QueryNodeQuotaMetrics, error
|
||||||
}
|
}
|
||||||
|
|
||||||
minTsafeChannel, minTsafe := node.tSafeManager.Min()
|
minTsafeChannel, minTsafe := node.tSafeManager.Min()
|
||||||
|
|
||||||
collections := node.manager.Collection.List()
|
collections := node.manager.Collection.List()
|
||||||
|
|
||||||
nodeID := fmt.Sprint(node.GetNodeID())
|
nodeID := fmt.Sprint(node.GetNodeID())
|
||||||
|
|
||||||
|
metrics.QueryNodeNumEntities.Reset()
|
||||||
|
metrics.QueryNodeEntitiesSize.Reset()
|
||||||
|
|
||||||
var totalGrowingSize int64
|
var totalGrowingSize int64
|
||||||
growingSegments := node.manager.Segment.GetBy(segments.WithType(segments.SegmentTypeGrowing))
|
growingSegments := node.manager.Segment.GetBy(segments.WithType(segments.SegmentTypeGrowing))
|
||||||
growingGroupByCollection := lo.GroupBy(growingSegments, func(seg segments.Segment) int64 {
|
growingGroupByCollection := lo.GroupBy(growingSegments, func(seg segments.Segment) int64 {
|
||||||
|
@ -125,6 +126,7 @@ func getQuotaMetrics(node *QueryNode) (*metricsinfo.QueryNodeQuotaMetrics, error
|
||||||
growingGroupByPartition := lo.GroupBy(growingSegments, func(seg segments.Segment) int64 {
|
growingGroupByPartition := lo.GroupBy(growingSegments, func(seg segments.Segment) int64 {
|
||||||
return seg.Partition()
|
return seg.Partition()
|
||||||
})
|
})
|
||||||
|
|
||||||
for _, segs := range growingGroupByPartition {
|
for _, segs := range growingGroupByPartition {
|
||||||
numEntities := lo.SumBy(segs, func(seg segments.Segment) int64 {
|
numEntities := lo.SumBy(segs, func(seg segments.Segment) int64 {
|
||||||
return seg.RowNum()
|
return seg.RowNum()
|
||||||
|
@ -136,7 +138,6 @@ func getQuotaMetrics(node *QueryNode) (*metricsinfo.QueryNodeQuotaMetrics, error
|
||||||
fmt.Sprint(segment.Collection()),
|
fmt.Sprint(segment.Collection()),
|
||||||
fmt.Sprint(segment.Partition()),
|
fmt.Sprint(segment.Partition()),
|
||||||
segments.SegmentTypeGrowing.String(),
|
segments.SegmentTypeGrowing.String(),
|
||||||
fmt.Sprint(len(segment.Indexes())),
|
|
||||||
).Set(float64(numEntities))
|
).Set(float64(numEntities))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,7 +167,6 @@ func getQuotaMetrics(node *QueryNode) (*metricsinfo.QueryNodeQuotaMetrics, error
|
||||||
fmt.Sprint(segment.Collection()),
|
fmt.Sprint(segment.Collection()),
|
||||||
fmt.Sprint(segment.Partition()),
|
fmt.Sprint(segment.Partition()),
|
||||||
segments.SegmentTypeSealed.String(),
|
segments.SegmentTypeSealed.String(),
|
||||||
fmt.Sprint(len(segment.Indexes())),
|
|
||||||
).Set(float64(numEntities))
|
).Set(float64(numEntities))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -370,7 +370,6 @@ var (
|
||||||
collectionIDLabelName,
|
collectionIDLabelName,
|
||||||
partitionIDLabelName,
|
partitionIDLabelName,
|
||||||
segmentStateLabelName,
|
segmentStateLabelName,
|
||||||
indexCountLabelName,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
QueryNodeEntitiesSize = prometheus.NewGaugeVec(
|
QueryNodeEntitiesSize = prometheus.NewGaugeVec(
|
||||||
|
|
Loading…
Reference in New Issue