Fix metric of querynode's channel num (#22252)

Signed-off-by: xige-16 <xi.ge@zilliz.com>
pull/22257/head
xige-16 2023-02-20 19:08:26 +08:00 committed by GitHub
parent c8032f7e47
commit faf62cfa55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -101,6 +101,7 @@ func (c *Collection) removePartitionID(partitionID UniqueID) {
c.partitionIDs = tmpIDs
}
// not used
// addVChannels adds virtual channels to collection
func (c *Collection) addVChannels(channels []Channel) {
c.channelMu.Lock()
@ -151,7 +152,7 @@ func (c *Collection) removeVChannel(channel Channel) {
zap.String("channel", channel),
)
metrics.QueryNodeNumDmlChannels.WithLabelValues(fmt.Sprint(Params.QueryNodeCfg.GetNodeID())).Sub(float64(len(c.vChannels)))
metrics.QueryNodeNumDmlChannels.WithLabelValues(fmt.Sprint(Params.QueryNodeCfg.GetNodeID())).Set(float64(len(c.vChannels)))
}
// addPChannels add physical channels to physical channels of collection
@ -240,6 +241,8 @@ func (c *Collection) AddChannels(toLoadChannels []Channel, VPChannels map[string
}
}
}
metrics.QueryNodeNumDmlChannels.WithLabelValues(fmt.Sprint(Params.QueryNodeCfg.GetNodeID())).Set(float64(len(c.vChannels)))
return retVChannels
}
@ -261,6 +264,7 @@ func (c *Collection) isPChannelExist(channel string) bool {
return false
}
// not used
// addVChannels add virtual channels to collection
func (c *Collection) addVDeltaChannels(channels []Channel) {
c.channelMu.Lock()
@ -301,7 +305,7 @@ func (c *Collection) removeVDeltaChannel(channel Channel) {
zap.String("channel", channel),
)
metrics.QueryNodeNumDeltaChannels.WithLabelValues(fmt.Sprint(Params.QueryNodeCfg.GetNodeID())).Sub(float64(len(c.vDeltaChannels)))
metrics.QueryNodeNumDeltaChannels.WithLabelValues(fmt.Sprint(Params.QueryNodeCfg.GetNodeID())).Set(float64(len(c.vDeltaChannels)))
}
func (c *Collection) AddVDeltaChannels(toLoadChannels []Channel, VPChannels map[string]string) []Channel {
@ -318,6 +322,8 @@ func (c *Collection) AddVDeltaChannels(toLoadChannels []Channel, VPChannels map[
}
}
}
metrics.QueryNodeNumDeltaChannels.WithLabelValues(fmt.Sprint(Params.QueryNodeCfg.GetNodeID())).Set(float64(len(c.vDeltaChannels)))
return retVDeltaChannels
}