mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-02-02 01:06:41 +08:00
Fix metric QueryCoordNumCollections (#24053)
Signed-off-by: longjiquan <jiquan.long@zilliz.com>
This commit is contained in:
parent
299561a242
commit
9eb78d5412
@ -234,7 +234,6 @@ func (job *LoadCollectionJob) Execute() error {
|
||||
return utils.WrapError(msg, err)
|
||||
}
|
||||
|
||||
metrics.QueryCoordNumCollections.WithLabelValues().Inc()
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -439,7 +438,6 @@ func (job *LoadPartitionJob) Execute() error {
|
||||
return utils.WrapError(msg, err)
|
||||
}
|
||||
|
||||
metrics.QueryCoordNumCollections.WithLabelValues().Inc()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@ -223,6 +223,11 @@ func (ob *CollectionObserver) observeCollectionLoadStatus(collection *meta.Colle
|
||||
ob.meta.CollectionManager.UpdateCollection(updated)
|
||||
|
||||
elapsed := time.Since(updated.CreatedAt)
|
||||
|
||||
// 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.QueryCoordLoadLatency.WithLabelValues().Observe(float64(elapsed.Milliseconds()))
|
||||
} else {
|
||||
ob.meta.CollectionManager.UpdateCollectionInMemory(updated)
|
||||
|
||||
@ -307,7 +307,9 @@ func (s *Server) initMeta() error {
|
||||
log.Error("failed to recover collections")
|
||||
return err
|
||||
}
|
||||
metrics.QueryCoordNumCollections.WithLabelValues().Set(float64(len(s.meta.GetAll())))
|
||||
|
||||
// We really update the metric after observers think the collection loaded.
|
||||
metrics.QueryCoordNumCollections.WithLabelValues().Set(0)
|
||||
|
||||
err = s.meta.ReplicaManager.Recover(s.meta.CollectionManager.GetAll())
|
||||
if err != nil {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user