Remove bad & duplicate metric (#20905)

/kind improvement

Signed-off-by: Yuchen Gao <yuchen.gao@zilliz.com>

Signed-off-by: Yuchen Gao <yuchen.gao@zilliz.com>
pull/20935/head
Ten Thousand Leaves 2022-12-01 16:39:16 +08:00 committed by GitHub
parent 9a42cff9b4
commit b238f4ee58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 23 deletions

View File

@ -23,20 +23,16 @@ import (
"sync" "sync"
"time" "time"
"github.com/samber/lo"
"go.uber.org/zap"
"github.com/milvus-io/milvus-proto/go-api/schemapb" "github.com/milvus-io/milvus-proto/go-api/schemapb"
"github.com/milvus-io/milvus/internal/common" "github.com/milvus-io/milvus/internal/common"
"github.com/milvus-io/milvus/internal/log" "github.com/milvus-io/milvus/internal/log"
"github.com/milvus-io/milvus/internal/metrics"
"github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/proto/datapb"
"github.com/milvus-io/milvus/internal/proto/internalpb" "github.com/milvus-io/milvus/internal/proto/internalpb"
"github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/internal/storage"
"github.com/milvus-io/milvus/internal/types" "github.com/milvus-io/milvus/internal/types"
"github.com/milvus-io/milvus/internal/util/paramtable"
"github.com/milvus-io/milvus/internal/util/typeutil" "github.com/milvus-io/milvus/internal/util/typeutil"
"github.com/samber/lo"
"go.uber.org/zap"
) )
type ( type (
@ -138,7 +134,6 @@ func (c *ChannelMeta) segmentFlushed(segID UniqueID) {
if seg, ok := c.segments[segID]; ok { if seg, ok := c.segments[segID]; ok {
seg.setType(datapb.SegmentType_Flushed) seg.setType(datapb.SegmentType_Flushed)
} }
metrics.DataNodeNumUnflushedSegments.WithLabelValues(fmt.Sprint(paramtable.GetNodeID())).Dec()
} }
// new2NormalSegment transfers a segment from *New* to *Normal*. // new2NormalSegment transfers a segment from *New* to *Normal*.
@ -224,9 +219,6 @@ func (c *ChannelMeta) addSegment(req addSegmentReq) error {
c.segMu.Lock() c.segMu.Lock()
c.segments[req.segID] = seg c.segments[req.segID] = seg
c.segMu.Unlock() c.segMu.Unlock()
if req.segType == datapb.SegmentType_New || req.segType == datapb.SegmentType_Normal {
metrics.DataNodeNumUnflushedSegments.WithLabelValues(fmt.Sprint(paramtable.GetNodeID())).Inc()
}
return nil return nil
} }
@ -441,7 +433,6 @@ func (c *ChannelMeta) removeSegments(segIDs ...UniqueID) {
delete(c.segments, segID) delete(c.segments, segID)
} }
metrics.DataNodeNumUnflushedSegments.WithLabelValues(fmt.Sprint(paramtable.GetNodeID())).Sub(float64(cnt))
} }
// hasSegment checks whether this channel has a segment according to segment ID. // hasSegment checks whether this channel has a segment according to segment ID.

View File

@ -112,16 +112,6 @@ var (
collectionIDLabelName, collectionIDLabelName,
}) })
DataNodeNumUnflushedSegments = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: milvusNamespace,
Subsystem: typeutil.DataNodeRole,
Name: "unflushed_segment_num",
Help: "number of unflushed segments",
}, []string{
nodeIDLabelName,
})
DataNodeEncodeBufferLatency = prometheus.NewHistogramVec( // TODO: arguably DataNodeEncodeBufferLatency = prometheus.NewHistogramVec( // TODO: arguably
prometheus.HistogramOpts{ prometheus.HistogramOpts{
Namespace: milvusNamespace, Namespace: milvusNamespace,
@ -209,7 +199,7 @@ var (
}, []string{nodeIDLabelName}) }, []string{nodeIDLabelName})
) )
//RegisterDataNode registers DataNode metrics // RegisterDataNode registers DataNode metrics
func RegisterDataNode(registry *prometheus.Registry) { func RegisterDataNode(registry *prometheus.Registry) {
registry.MustRegister(DataNodeNumFlowGraphs) registry.MustRegister(DataNodeNumFlowGraphs)
registry.MustRegister(DataNodeConsumeMsgRowsCount) registry.MustRegister(DataNodeConsumeMsgRowsCount)
@ -217,7 +207,6 @@ func RegisterDataNode(registry *prometheus.Registry) {
registry.MustRegister(DataNodeNumConsumers) registry.MustRegister(DataNodeNumConsumers)
registry.MustRegister(DataNodeNumProducers) registry.MustRegister(DataNodeNumProducers)
registry.MustRegister(DataNodeConsumeTimeTickLag) registry.MustRegister(DataNodeConsumeTimeTickLag)
registry.MustRegister(DataNodeNumUnflushedSegments)
registry.MustRegister(DataNodeEncodeBufferLatency) registry.MustRegister(DataNodeEncodeBufferLatency)
registry.MustRegister(DataNodeSave2StorageLatency) registry.MustRegister(DataNodeSave2StorageLatency)
registry.MustRegister(DataNodeFlushBufferCount) registry.MustRegister(DataNodeFlushBufferCount)