mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-28 14:35:27 +08:00
enhance: Improve disk quota metrics update when cluster quota changes (#46278)
issue: #46277 - Update db/collection/partition disk quota metrics when cluster disk quota changes, since they use cluster quota as default value - Fix incorrect label "collection" to "partition" in disk quota per partition watcher Signed-off-by: Wei Liu <wei.liu@zilliz.com>
This commit is contained in:
parent
82e1dfc7d0
commit
d2c403ce4b
@ -306,6 +306,10 @@ func (q *QuotaCenter) watchQuotaAndLimit() {
|
||||
}))
|
||||
pt.Watch(pt.QuotaConfig.DiskQuota.Key, config.NewHandler(pt.QuotaConfig.DiskQuota.Key, func(event *config.Event) {
|
||||
metrics.DiskQuota.WithLabelValues(paramtable.GetStringNodeID(), "cluster").Set(pt.QuotaConfig.DiskQuota.GetAsFloat())
|
||||
// cause db/collection/partition quota will use cluster quota as default, so we need to update them when cluster quota is updated
|
||||
metrics.DiskQuota.WithLabelValues(paramtable.GetStringNodeID(), "db").Set(pt.QuotaConfig.DiskQuotaPerDB.GetAsFloat())
|
||||
metrics.DiskQuota.WithLabelValues(paramtable.GetStringNodeID(), "collection").Set(pt.QuotaConfig.DiskQuotaPerCollection.GetAsFloat())
|
||||
metrics.DiskQuota.WithLabelValues(paramtable.GetStringNodeID(), "partition").Set(pt.QuotaConfig.DiskQuotaPerPartition.GetAsFloat())
|
||||
}))
|
||||
pt.Watch(pt.QuotaConfig.DiskQuotaPerDB.Key, config.NewHandler(pt.QuotaConfig.DiskQuotaPerDB.Key, func(event *config.Event) {
|
||||
metrics.DiskQuota.WithLabelValues(paramtable.GetStringNodeID(), "db").Set(pt.QuotaConfig.DiskQuotaPerDB.GetAsFloat())
|
||||
@ -314,7 +318,7 @@ func (q *QuotaCenter) watchQuotaAndLimit() {
|
||||
metrics.DiskQuota.WithLabelValues(paramtable.GetStringNodeID(), "collection").Set(pt.QuotaConfig.DiskQuotaPerCollection.GetAsFloat())
|
||||
}))
|
||||
pt.Watch(pt.QuotaConfig.DiskQuotaPerPartition.Key, config.NewHandler(pt.QuotaConfig.DiskQuotaPerPartition.Key, func(event *config.Event) {
|
||||
metrics.DiskQuota.WithLabelValues(paramtable.GetStringNodeID(), "collection").Set(pt.QuotaConfig.DiskQuotaPerPartition.GetAsFloat())
|
||||
metrics.DiskQuota.WithLabelValues(paramtable.GetStringNodeID(), "partition").Set(pt.QuotaConfig.DiskQuotaPerPartition.GetAsFloat())
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user