manager

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MQPayload

type MQPayload []MetricPayload

type Manager

type Manager interface {
	// Initialize the Metric Manager with a list of metrics to track
	Init(MetricSpec) *prometheus.Registry
	// Update a set of metrics in a single message payload
	Update(MQPayload)
}

type MetricConfig

type MetricConfig struct {
	MQName   string `yaml:"mq_name"`
	PromName string `yaml:"prom_name"`
	Help     string
	Type     MetricType
	Labels   []string
}

type MetricPayload

type MetricPayload struct {
	Name   string
	Value  float64
	Labels map[string]string
}

type MetricSpec

type MetricSpec struct {
	Metrics []MetricConfig
}

type MetricType

type MetricType int64
const (
	Gauge MetricType = iota
	Counter
)

func (*MetricType) UnmarshalYAML

func (mt *MetricType) UnmarshalYAML(node *yaml.Node) error

type SimpleManager

type SimpleManager struct {
	// contains filtered or unexported fields
}

This can be simplified into one array of struct that contains both the Type and the Collector

func NewSimpleManager

func NewSimpleManager() *SimpleManager

func (*SimpleManager) Init

func (m *SimpleManager) Init(metricSpec MetricSpec) *prometheus.Registry

func (*SimpleManager) Update

func (m *SimpleManager) Update(mqpayload MQPayload)

Jump to

Keyboard shortcuts

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