fix: binlog count use correct value (#44830)

Related to #44789

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
congqixia 2025-10-14 16:48:05 +08:00 committed by GitHub
parent 4b84ba2189
commit 92910117a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -477,7 +477,7 @@ func (m *meta) GetQuotaInfo() *metricsinfo.DataCoordQuotaMetrics {
segments := m.segments.GetSegments()
var total int64
storedBinlogSize := make(map[string]map[string]int64) // map[collectionID]map[segment_state]size
binlogFileSize := make(map[string]int64) // map[collectionID]size
binlogFileCount := make(map[string]int64) // map[collectionID]count
coll2DbName := make(map[string]string)
for _, segment := range segments {
@ -502,7 +502,7 @@ func (m *meta) GetQuotaInfo() *metricsinfo.DataCoordQuotaMetrics {
}
storedBinlogSize[collIDStr][segment.GetState().String()] += segmentSize
binlogFileSize[collIDStr] += segmentSize
binlogFileCount[collIDStr] += int64(getBinlogFileCount(segment.SegmentInfo))
} else {
log.Ctx(context.TODO()).Warn("not found database name", zap.Int64("collectionID", segment.GetCollectionID()))
}
@ -527,7 +527,7 @@ func (m *meta) GetQuotaInfo() *metricsinfo.DataCoordQuotaMetrics {
}
// Reset to remove dropped collection
metrics.DataCoordSegmentBinLogFileCount.Reset()
for collectionID, size := range binlogFileSize {
for collectionID, size := range binlogFileCount {
metrics.DataCoordSegmentBinLogFileCount.WithLabelValues(collectionID).Set(float64(size))
}