mirror of https://github.com/milvus-io/milvus.git
enhance: Unify querycoord meta metrics (#38233)
Related to #36456 Unify collection/partition number metrics to collection manager in case of unwant missing modification Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>pull/38252/head
parent
7944538ade
commit
32645fc28a
|
@ -112,8 +112,6 @@ func (job *ReleaseCollectionJob) Execute() error {
|
|||
proxyutil.SetMsgType(commonpb.MsgType_ReleaseCollection))
|
||||
|
||||
waitCollectionReleased(job.dist, job.checkerController, req.GetCollectionID())
|
||||
metrics.QueryCoordNumCollections.WithLabelValues().Dec()
|
||||
metrics.QueryCoordNumPartitions.WithLabelValues().Sub(float64(len(toRelease)))
|
||||
metrics.QueryCoordReleaseCount.WithLabelValues(metrics.TotalLabel).Inc()
|
||||
metrics.QueryCoordReleaseCount.WithLabelValues(metrics.SuccessLabel).Inc()
|
||||
return nil
|
||||
|
@ -196,7 +194,6 @@ func (job *ReleasePartitionJob) Execute() error {
|
|||
log.Warn("failed to remove replicas", zap.Error(err))
|
||||
}
|
||||
job.targetObserver.ReleaseCollection(req.GetCollectionID())
|
||||
metrics.QueryCoordNumCollections.WithLabelValues().Dec()
|
||||
// try best discard cache
|
||||
// shall not affect releasing if failed
|
||||
job.proxyManager.InvalidateCollectionMetaCache(job.ctx,
|
||||
|
@ -216,6 +213,5 @@ func (job *ReleasePartitionJob) Execute() error {
|
|||
job.targetObserver.ReleasePartition(req.GetCollectionID(), toRelease...)
|
||||
waitCollectionReleased(job.dist, job.checkerController, req.GetCollectionID(), toRelease...)
|
||||
}
|
||||
metrics.QueryCoordNumPartitions.WithLabelValues().Sub(float64(len(toRelease)))
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -591,6 +591,7 @@ func (m *CollectionManager) UpdateLoadPercent(ctx context.Context, partitionID i
|
|||
newCollection.RecoverTimes = 0
|
||||
|
||||
metrics.QueryCoordNumCollections.WithLabelValues().Set(float64(len(lo.Values(m.collections))))
|
||||
metrics.QueryCoordNumPartitions.WithLabelValues().Set(float64(len(m.partitions)))
|
||||
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)))
|
||||
|
@ -616,6 +617,8 @@ func (m *CollectionManager) RemoveCollection(ctx context.Context, collectionID t
|
|||
delete(m.collectionPartitions, collectionID)
|
||||
}
|
||||
metrics.CleanQueryCoordMetricsWithCollectionID(collectionID)
|
||||
metrics.QueryCoordNumPartitions.WithLabelValues().Set(float64(len(m.partitions)))
|
||||
metrics.QueryCoordNumCollections.WithLabelValues().Set(float64(len(lo.Values(m.collections))))
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -627,7 +630,9 @@ func (m *CollectionManager) RemovePartition(ctx context.Context, collectionID ty
|
|||
m.rwmutex.Lock()
|
||||
defer m.rwmutex.Unlock()
|
||||
|
||||
return m.removePartition(ctx, collectionID, partitionIDs...)
|
||||
err := m.removePartition(ctx, collectionID, partitionIDs...)
|
||||
metrics.QueryCoordNumPartitions.WithLabelValues().Set(float64(len(m.partitions)))
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *CollectionManager) removePartition(ctx context.Context, collectionID typeutil.UniqueID, partitionIDs ...typeutil.UniqueID) error {
|
||||
|
|
Loading…
Reference in New Issue