package metrics

import "github.com/prometheus/client_golang/prometheus"

const (
	eventbusSubsystem = "eventbus"
)

var EventBus = eventbusMetrics{
	EventHandleDur: prometheus.NewSummaryVec(
		prometheus.SummaryOpts{
			Namespace: Namespace,
			Subsystem: eventbusSubsystem,
			Name:      "event_handle_duration_seconds",
			Help:      "The event handle latencies in seconds.",
		},
		[]string{"topic", "result", "group_key"},
	),
	EventPushTotal: prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: Namespace,
			Subsystem: eventbusSubsystem,
			Name:      "event_push_total",
			Help:      "How many events pushed to eventbus.",
		},
		[]string{"topic", "result"},
	),
}

type eventbusMetrics struct {
	EventHandleDur *prometheus.SummaryVec
	EventPushTotal *prometheus.CounterVec
}
