metrics

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSessionAliasLabelName = "session_alias"
	DefaultDirectionLabelName    = "direction"
	DefaultExchangeLabelName     = "exchange"
	DefaultRoutingKeyLabelName   = "routing_key"
	DefaultQueueLabelName        = "queue"
	DefaultMessageTypeLabelName  = "message_type"
	DefaultTh2PinLabelName       = "th2_pin"
	DefaultTh2TypeLabelName      = "th2_type"
	MessageGroupTh2Type          = "MESSAGE_GROUP"
	EventTh2Type                 = "EVENT"
	RawMessageType               = "RAW_MESSAGE"
	ParsedMessageType            = "MESSAGE"
)

Variables

View Source
var DefaultBuckets = []float64{0.000_25, 0.000_5, 0.001, 0.005, 0.010, 0.015, 0.025, 0.050, 0.100, 0.250, 0.500, 1.0}

Functions

func UpdateMessageMetrics

func UpdateMessageMetrics(batch *p_buff.MessageGroupBatch, counter *prometheus.CounterVec, th2Pin string)

Types

type FileFlag

type FileFlag struct {
	Enabled bool
	// contains filtered or unexported fields
}

func NewFileFlag

func NewFileFlag(filename string) *FileFlag

func (*FileFlag) Disable

func (fm *FileFlag) Disable()

func (*FileFlag) Enable

func (fm *FileFlag) Enable()

func (*FileFlag) IsEnabled

func (fm *FileFlag) IsEnabled() bool

func (*FileFlag) OnValueChange

func (fm *FileFlag) OnValueChange(value bool)

type Flag

type Flag interface {
	IsEnabled() bool
	Enable()
	Disable()
}

type FlagArbiter

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

func NewFlagArbiter

func NewFlagArbiter(flags ...Flag) *FlagArbiter

func (*FlagArbiter) DisableMonitor

func (flagArb *FlagArbiter) DisableMonitor(name string)

func (*FlagArbiter) EnableMonitor

func (flagArb *FlagArbiter) EnableMonitor(name string)

func (*FlagArbiter) RegisterMonitor

func (flagArb *FlagArbiter) RegisterMonitor(name string) *Monitor

type HealthMetrics

type HealthMetrics struct {
	LivenessMonitor  *Monitor
	ReadinessMonitor *Monitor
}

func NewHealthMetrics

func NewHealthMetrics(obj interface{}, liveness *FlagArbiter, readiness *FlagArbiter) *HealthMetrics

func (*HealthMetrics) Disable

func (hlmetr *HealthMetrics) Disable()

func (*HealthMetrics) Enable

func (hlmetr *HealthMetrics) Enable()

type MetricFlag

type MetricFlag struct {
	Enabled bool
	// contains filtered or unexported fields
}

func NewMetricFlag

func NewMetricFlag(name string, help string) *MetricFlag

func (*MetricFlag) Disable

func (promMetric *MetricFlag) Disable()

func (*MetricFlag) Enable

func (promMetric *MetricFlag) Enable()

func (*MetricFlag) IsEnabled

func (promMetric *MetricFlag) IsEnabled() bool

func (*MetricFlag) OnValueChange

func (promMetric *MetricFlag) OnValueChange(value bool)

type Monitor

type Monitor struct {
	Name        string
	FlagArbiter *FlagArbiter
}

func (*Monitor) Disable

func (mon *Monitor) Disable()

func (*Monitor) Enable

func (mon *Monitor) Enable()

func (*Monitor) IsEnabled

func (mon *Monitor) IsEnabled() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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