mirror of https://github.com/milvus-io/milvus.git
enhance: Add metrics for Delete entries num of L0seg (#36175)
- Add metrics *DataCoordL0DeleteEntriesNum* - Remove metrics *DataCoordRateStoredL0Segment* See also: #36147 --------- Signed-off-by: yangxuan <xuan.yang@zilliz.com>pull/36218/head
parent
b5ff348906
commit
e8840a1b41
|
@ -447,14 +447,22 @@ func (m *meta) GetQuotaInfo() *metricsinfo.DataCoordQuotaMetrics {
|
|||
|
||||
metrics.DataCoordNumStoredRows.Reset()
|
||||
for collectionID, statesRows := range collectionRowsNum {
|
||||
for state, rows := range statesRows {
|
||||
coll, ok := m.collections[collectionID]
|
||||
if ok {
|
||||
coll, ok := m.collections[collectionID]
|
||||
if ok {
|
||||
for state, rows := range statesRows {
|
||||
metrics.DataCoordNumStoredRows.WithLabelValues(coll.DatabaseName, fmt.Sprint(collectionID), state.String()).Set(float64(rows))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
metrics.DataCoordL0DeleteEntriesNum.Reset()
|
||||
for collectionID, entriesNum := range collectionL0RowCounts {
|
||||
coll, ok := m.collections[collectionID]
|
||||
if ok {
|
||||
metrics.DataCoordL0DeleteEntriesNum.WithLabelValues(coll.DatabaseName, fmt.Sprint(collectionID)).Set(float64(entriesNum))
|
||||
}
|
||||
}
|
||||
|
||||
info.TotalBinlogSize = total
|
||||
info.CollectionBinlogSize = collectionBinlogSize
|
||||
info.PartitionsBinlogSize = partitionBinlogSize
|
||||
|
|
|
@ -567,8 +567,6 @@ func (s *Server) SaveBinlogPaths(ctx context.Context, req *datapb.SaveBinlogPath
|
|||
|
||||
if req.GetSegLevel() == datapb.SegmentLevel_L0 {
|
||||
metrics.DataCoordSizeStoredL0Segment.WithLabelValues(fmt.Sprint(req.GetCollectionID())).Observe(calculateL0SegmentSize(req.GetField2StatslogPaths()))
|
||||
metrics.DataCoordRateStoredL0Segment.WithLabelValues().Inc()
|
||||
|
||||
return merr.Success(), nil
|
||||
}
|
||||
|
||||
|
|
|
@ -73,13 +73,16 @@ var (
|
|||
collectionIDLabelName,
|
||||
})
|
||||
|
||||
DataCoordRateStoredL0Segment = prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
DataCoordL0DeleteEntriesNum = prometheus.NewGaugeVec(
|
||||
prometheus.GaugeOpts{
|
||||
Namespace: milvusNamespace,
|
||||
Subsystem: typeutil.DataCoordRole,
|
||||
Name: "store_level0_segment_rate",
|
||||
Help: "stored l0 segment rate",
|
||||
}, []string{})
|
||||
Name: "l0_delete_entries_num",
|
||||
Help: "Delete entries number of Level zero segment",
|
||||
}, []string{
|
||||
databaseLabelName,
|
||||
collectionIDLabelName,
|
||||
})
|
||||
|
||||
// DataCoordNumStoredRows all metrics will be cleaned up after removing matched collectionID and
|
||||
// segment state labels in CleanupDataCoordNumStoredRows method.
|
||||
|
@ -349,7 +352,7 @@ func RegisterDataCoord(registry *prometheus.Registry) {
|
|||
registry.MustRegister(DataCoordCompactionTaskNum)
|
||||
registry.MustRegister(DataCoordCompactionLatency)
|
||||
registry.MustRegister(DataCoordSizeStoredL0Segment)
|
||||
registry.MustRegister(DataCoordRateStoredL0Segment)
|
||||
registry.MustRegister(DataCoordL0DeleteEntriesNum)
|
||||
registry.MustRegister(FlushedSegmentFileNum)
|
||||
registry.MustRegister(IndexRequestCounter)
|
||||
registry.MustRegister(IndexTaskNum)
|
||||
|
@ -402,4 +405,7 @@ func CleanupDataCoordWithCollectionID(collectionID int64) {
|
|||
DataCoordSizeStoredL0Segment.Delete(prometheus.Labels{
|
||||
collectionIDLabelName: fmt.Sprint(collectionID),
|
||||
})
|
||||
DataCoordL0DeleteEntriesNum.DeletePartialMatch(prometheus.Labels{
|
||||
collectionIDLabelName: fmt.Sprint(collectionID),
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue