diff --git a/pkg/statistics/handle/cache/statscache.go b/pkg/statistics/handle/cache/statscache.go index c9dc27760e168..5a22fb9d43a46 100644 --- a/pkg/statistics/handle/cache/statscache.go +++ b/pkg/statistics/handle/cache/statscache.go @@ -207,7 +207,7 @@ func (s *StatsCacheImpl) UpdateStatsHealthyMetrics() { distribution := make([]int64, 9) uneligibleAnalyze := 0 for _, tbl := range s.Values() { - distribution[4]++ // total table count + distribution[7]++ // total table count isEligibleForAnalysis := tbl.IsEligibleForAnalysis() if !isEligibleForAnalysis { uneligibleAnalyze++ diff --git a/pkg/statistics/handle/metrics/metrics.go b/pkg/statistics/handle/metrics/metrics.go index 34841146a625e..7502b26d72be2 100644 --- a/pkg/statistics/handle/metrics/metrics.go +++ b/pkg/statistics/handle/metrics/metrics.go @@ -34,16 +34,15 @@ func init() { // InitMetricsVars init statistics metrics vars. func InitMetricsVars() { StatsHealthyGauges = []prometheus.Gauge{ - metrics.StatsHealthyGauge.WithLabelValues("[0,50)"), - metrics.StatsHealthyGauge.WithLabelValues("[50,55)"), - metrics.StatsHealthyGauge.WithLabelValues("[55,60)"), - metrics.StatsHealthyGauge.WithLabelValues("[60,70)"), - metrics.StatsHealthyGauge.WithLabelValues("[70,80)"), - metrics.StatsHealthyGauge.WithLabelValues("[80,100)"), - metrics.StatsHealthyGauge.WithLabelValues("[100,100]"), - // [0,100] should always be the last - metrics.StatsHealthyGauge.WithLabelValues("[0,100]"), - metrics.StatsHealthyGauge.WithLabelValues("unneeded analyze"), + metrics.StatsHealthyGauge.WithLabelValues("[0,50)"), // 0 + metrics.StatsHealthyGauge.WithLabelValues("[50,55)"), // 1 + metrics.StatsHealthyGauge.WithLabelValues("[55,60)"), // 2 + metrics.StatsHealthyGauge.WithLabelValues("[60,70)"), // 3 + metrics.StatsHealthyGauge.WithLabelValues("[70,80)"), // 4 + metrics.StatsHealthyGauge.WithLabelValues("[80,100)"), // 5 + metrics.StatsHealthyGauge.WithLabelValues("[100,100]"), // 6 + metrics.StatsHealthyGauge.WithLabelValues("[0,100]"), // 7 + metrics.StatsHealthyGauge.WithLabelValues("unneeded analyze"), // 8 } DumpHistoricalStatsSuccessCounter = metrics.HistoricalStatsCounter.WithLabelValues("dump", "success")