Record load latency for loaded collection (#20538)

Signed-off-by: yah01 <yang.cen@zilliz.com>

Signed-off-by: yah01 <yang.cen@zilliz.com>
This commit is contained in:
yah01 2022-11-15 10:11:07 +08:00 committed by GitHub
parent bec1d4c50f
commit d37ebe538b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 9 deletions

View File

@ -64,8 +64,8 @@ var (
Namespace: milvusNamespace, Namespace: milvusNamespace,
Subsystem: typeutil.QueryCoordRole, Subsystem: typeutil.QueryCoordRole,
Name: "load_latency", Name: "load_latency",
Help: "latency of load request", Help: "latency of load the entire collection",
Buckets: buckets, Buckets: []float64{0, 500, 1000, 2000, 5000, 10000, 20000, 50000, 60000, 300000, 600000, 1800000},
}, []string{}) }, []string{})
QueryCoordReleaseLatency = prometheus.NewHistogramVec( QueryCoordReleaseLatency = prometheus.NewHistogramVec(

View File

@ -167,6 +167,7 @@ func (job *LoadCollectionJob) PreExecute() error {
log.Warn(msg) log.Warn(msg)
return utils.WrapError(msg, ErrLoadParameterMismatched) return utils.WrapError(msg, ErrLoadParameterMismatched)
} }
return ErrCollectionLoaded return ErrCollectionLoaded
} }

View File

@ -158,9 +158,9 @@ func (ob *CollectionObserver) observeCollectionLoadStatus(collection *meta.Colle
channelTargets := ob.targetMgr.GetDmChannelsByCollection(collection.GetCollectionID(), meta.NextTarget) channelTargets := ob.targetMgr.GetDmChannelsByCollection(collection.GetCollectionID(), meta.NextTarget)
targetNum := len(segmentTargets) + len(channelTargets) targetNum := len(segmentTargets) + len(channelTargets)
log.Info("collection targets", log.Info("collection targets",
zap.Int("segment-target-num", len(segmentTargets)), zap.Int("segmentTargetNum", len(segmentTargets)),
zap.Int("channel-target-num", len(channelTargets)), zap.Int("channelTargetNum", len(channelTargets)),
zap.Int("total-target-num", targetNum)) zap.Int("totalTargetNum", targetNum))
updated := collection.Clone() updated := collection.Clone()
loadedCount := 0 loadedCount := 0
@ -187,8 +187,8 @@ func (ob *CollectionObserver) observeCollectionLoadStatus(collection *meta.Colle
} }
if loadedCount > 0 { if loadedCount > 0 {
log.Info("collection load progress", log.Info("collection load progress",
zap.Int("sub-channel-count", subChannelCount), zap.Int("subChannelCount", subChannelCount),
zap.Int("load-segment-count", loadedCount-subChannelCount), zap.Int("loadSegmentCount", loadedCount-subChannelCount),
) )
} }
@ -253,8 +253,8 @@ func (ob *CollectionObserver) observePartitionLoadStatus(partition *meta.Partiti
} }
if loadedCount > 0 { if loadedCount > 0 {
log.Info("partition load progress", log.Info("partition load progress",
zap.Int("sub-channel-count", subChannelCount), zap.Int("subChannelCount", subChannelCount),
zap.Int("load-segment-count", loadedCount-subChannelCount)) zap.Int("loadSegmentCount", loadedCount-subChannelCount))
} }
updated.LoadPercentage = int32(loadedCount * 100 / targetNum) updated.LoadPercentage = int32(loadedCount * 100 / targetNum)