Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterCollector ¶
func RegisterCollector[T Collector](newFunc NewCollectorFunc[T])
RegisterCollector registers a new collector type with the metrics package.
Types ¶
type Collector ¶
type Collector interface {
// Name returns the name of the collector.
Name() string
// Type returns the type of the collector.
Type() string
// Configure sets up the collector with the provided settings.
Configure(settings map[string]any) error
// Run continuously runs the collection process until the context is
// cancelled. The function should block until the context is cancelled, an
// error occurs, or the Stop function is called.
Run(ctx context.Context) error
// Results returns the collected metrics.
Results() []Results
}
Click to show internal directories.
Click to hide internal directories.