Skip to content

Commit

Permalink
fix: querycoord collection num metric (milvus-io#36471)
Browse files Browse the repository at this point in the history
related to: milvus-io#36456

Signed-off-by: shaoting-huang <[email protected]>
  • Loading branch information
shaoting-huang authored Sep 26, 2024
1 parent 954d8a5 commit 4493aa2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions internal/querycoordv2/meta/collection_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit 4493aa2

Please sign in to comment.