Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseKPI ¶
type BaseKPI[Opts any] struct { // Options to pass via json to this step. conf.JsonOpts[Opts] // Database connection. DB db.DB }
Common base for all KPIs that provides some functionality that would otherwise be duplicated across all KPIs.
type KPI ¶
type KPI interface {
// Configure the kpi with a database, options, and the
// registry to publish metrics on.
Init(db db.DB, opts conf.RawOpts) error
// Collect the kpi from the given data.
Collect(ch chan<- prometheus.Metric)
// Describe this metric.
Describe(ch chan<- *prometheus.Desc)
// Get the name of this kpi.
// This name is used to identify the kpi in metrics, config, logs, etc.
// Should be something like: "my_cool_kpi".
GetName() string
}
Each kpi plugin must conform to this interface.
Click to show internal directories.
Click to hide internal directories.