Skip to content

Commit

Permalink
address
Browse files Browse the repository at this point in the history
Signed-off-by: nolouch <[email protected]>
  • Loading branch information
nolouch authored and ti-chi-bot committed Sep 20, 2024
1 parent b20e2e4 commit 2c3e56e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
11 changes: 3 additions & 8 deletions pkg/mcs/resourcemanager/server/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ const (

reservedDefaultGroupName = "default"
middlePriority = 8

// Labels for the metrics.
ruPerSec = "ru_per_sec"
ruCapacity = "ru_capacity"
priority = "priority"
)

// Manager is the manager of resource group.
Expand Down Expand Up @@ -480,9 +475,9 @@ func (m *Manager) backgroundMetricsFlush(ctx context.Context) {
ru = 0
}
availableRUCounter.WithLabelValues(group.Name, group.Name).Set(ru)
resourceGroupConfigGauge.WithLabelValues(group.Name, priority).Set(float64(group.Priority))
resourceGroupConfigGauge.WithLabelValues(group.Name, ruPerSec).Set(float64(group.RUSettings.RU.Settings.FillRate))
resourceGroupConfigGauge.WithLabelValues(group.Name, ruCapacity).Set(float64(group.RUSettings.RU.Settings.BurstLimit))
resourceGroupConfigGauge.WithLabelValues(group.Name, priorityLabel).Set(float64(group.Priority))
resourceGroupConfigGauge.WithLabelValues(group.Name, ruPerSecLabel).Set(float64(group.RUSettings.RU.Settings.FillRate))
resourceGroupConfigGauge.WithLabelValues(group.Name, ruCapacityLabel).Set(float64(group.RUSettings.RU.Settings.BurstLimit))
}
case <-recordMaxTicker.C:
// Record the sum of RRU and WRU every second.
Expand Down
7 changes: 6 additions & 1 deletion pkg/mcs/resourcemanager/server/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ const (
tiflashTypeLabel = "ap"
defaultTypeLabel = "tp"
newResourceGroupNameLabel = "resource_group"

// Labels for the config.
ruPerSecLabel = "ru_per_sec"
ruCapacityLabel = "ru_capacity"
priorityLabel = "priority"
)

var (
Expand Down Expand Up @@ -123,7 +128,7 @@ var (
Subsystem: serverSubsystem,
Name: "group_config",
Help: "Config of the resource group.",
}, []string{newResourceGroupNameLabel, "type"})
}, []string{newResourceGroupNameLabel, typeLabel})
)

func init() {
Expand Down

0 comments on commit 2c3e56e

Please sign in to comment.