fix: querycoord collection num metric (#36471)

related to: #36456

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
pull/36540/head
sthuang 2024-09-26 14:23:13 +08:00 committed by GitHub
parent 954d8a5f68
commit 4493aa2142
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 3 deletions

View File

@ -582,9 +582,7 @@ func (m *CollectionManager) UpdateLoadPercent(partitionID int64, loadPercent int
// if collection becomes loaded, clear it's recoverTimes in load info
newCollection.RecoverTimes = 0
// TODO: what if part of the collection has been unloaded? Now we decrease the metric only after
// `ReleaseCollection` is triggered. Maybe it's hard to make this metric really accurate.
metrics.QueryCoordNumCollections.WithLabelValues().Inc()
metrics.QueryCoordNumCollections.WithLabelValues().Set(float64(len(lo.Values(m.collections))))
elapsed := time.Since(newCollection.CreatedAt)
metrics.QueryCoordLoadLatency.WithLabelValues().Observe(float64(elapsed.Milliseconds()))
eventlog.Record(eventlog.NewRawEvt(eventlog.Level_Info, fmt.Sprintf("Collection %d loaded", newCollection.CollectionID)))