package metrics

import (
	"github.com/prometheus/client_golang/prometheus"
	"sigs.k8s.io/controller-runtime/pkg/metrics"
)

const nodescorerComponent = "nodescorer"

var (
	NodesGauge = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Subsystem: nodescorerComponent,
			Name:      "node_size",
			Help:      "Gauge of node size in tidb pool",
		},
		[]string{},
	)

	NeedEvictNodesGauge = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Subsystem: nodescorerComponent,
			Name:      "need_evict_node_size",
			Help:      "Gauge of need evict node size in tidb pool",
		},
		[]string{"metric"},
	)
)

func init() {
	// Register custom metrics with the global prometheus registry
	metrics.Registry.MustRegister(NodesGauge)
	metrics.Registry.MustRegister(NeedEvictNodesGauge)
}
