package metrics

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

const tidbPDBComponent = "tidbpdb"

var (
	MinAvailableGauge = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Subsystem: tidbPDBComponent,
			Name:      "min_available",
			Help:      "Gauge of min available pods",
		},
		[]string{"pool_ns"},
	)

	CanEvictGauge = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Subsystem: tidbPDBComponent,
			Name:      "can_evict",
			Help:      "Gauge of can evict pods",
		},
		[]string{"pool_ns"},
	)
)

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