mirror of https://github.com/milvus-io/milvus.git
fix: Update disk usage metrics after segment released (#30702)
See also #30701 Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>pull/30718/head
parent
4a1d562d4a
commit
e5a16050ce
|
@ -1264,6 +1264,12 @@ func (s *LocalSegment) Release() {
|
|||
strconv.FormatInt(int64(len(s.Indexes())), 10),
|
||||
).Sub(float64(s.InsertCount()))
|
||||
|
||||
localDiskUsage, err := GetLocalUsedSize(context.Background(), paramtable.Get().LocalStorageCfg.Path.GetValue())
|
||||
// ignore error here, shall not block releasing
|
||||
if err == nil {
|
||||
metrics.QueryNodeDiskUsedSize.WithLabelValues(fmt.Sprint(paramtable.GetNodeID())).Set(float64(localDiskUsage) / 1024 / 1024) // in MB
|
||||
}
|
||||
|
||||
log.Info("delete segment from memory",
|
||||
zap.Int64("collectionID", s.collectionID),
|
||||
zap.Int64("partitionID", s.partitionID),
|
||||
|
|
Loading…
Reference in New Issue