metricsink

package
v1.14.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2025 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RegistrySingleton = Registry{
	Registry: *registry.NewRegistry("metricsink"),
}

RegistrySingleton is a global singleton

Functions

This section is empty.

Types

type AbstractMetricSink

type AbstractMetricSink struct {
	Logger         logger.Logger
	Name           string
	Kind           string
	MetricProvider MetricProvider
	StopChannel    chan struct{}
	StoppedChannel chan struct{}
}

AbstractMetricSink is the base struct for all metric sinks

func NewAbstractMetricSink

func NewAbstractMetricSink(logger logger.Logger,
	kind string,
	name string,
	metricProvider MetricProvider) (*AbstractMetricSink, error)

NewAbstractMetricSink creates a new abstract metric sink

func (*AbstractMetricSink) GetKind

func (at *AbstractMetricSink) GetKind() string

GetKind returns the kind of metric sink

func (*AbstractMetricSink) GetName

func (at *AbstractMetricSink) GetName() string

GetName returns the name of metric sink

func (*AbstractMetricSink) Start

func (at *AbstractMetricSink) Start() error

Start starts processing metrics

func (*AbstractMetricSink) Stop

func (at *AbstractMetricSink) Stop() chan struct{}

Stop stops processing metrics

type Configuration

type Configuration struct {
	platformconfig.MetricSink
	Name string
}

func NewConfiguration

func NewConfiguration(name string, metricSinkConfiguration *platformconfig.MetricSink) *Configuration

type Creator

type Creator interface {

	// Create creates a metric sink instance
	Create(logger.Logger, *processor.Configuration, string, *platformconfig.MetricSink, MetricProvider) (MetricSink, error)
}

Creator creates a metric sink instance

type MetricProvider

type MetricProvider interface {

	// GetTriggers returns all triggers of the processor, through which metricisinks can read
	// trigger, worker, worker pool metrics
	GetTriggers() []trigger.Trigger
}

MetricProvider provides access to all metrics of the processor

type MetricSink

type MetricSink interface {

	// Start starts processing metrics
	Start() error

	// Stop stops processing metrics, returns a channel that is closed when the sink actually stops
	Stop() chan struct{}

	// GetKind returns the kind of metric sink
	GetKind() string

	// GetName returns the name of metric sink
	GetName() string
}

type Registry

type Registry struct {
	registry.Registry
}

func (*Registry) NewMetricSink

func (r *Registry) NewMetricSink(logger logger.Logger,
	processorConfiguration *processor.Configuration,
	kind string,
	name string,
	metricSinkConfiguration *platformconfig.MetricSink,
	metricProvider MetricProvider) (MetricSink, error)

NewMetricSink creates a new metric sink

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL