event

package
v0.26.1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CounterEvent

type CounterEvent struct {
	CMetricName string
	CValue      float64
	CLabels     map[string]string
}

func (*CounterEvent) Labels

func (c *CounterEvent) Labels() map[string]string

func (*CounterEvent) MetricName

func (c *CounterEvent) MetricName() string

func (*CounterEvent) MetricType

func (c *CounterEvent) MetricType() mapper.MetricType

func (*CounterEvent) Value

func (c *CounterEvent) Value() float64

type Event

type Event interface {
	MetricName() string
	Value() float64
	Labels() map[string]string
	MetricType() mapper.MetricType
}

type EventHandler

type EventHandler interface {
	Queue(event Events)
}

type EventQueue

type EventQueue struct {
	C chan Events
	// contains filtered or unexported fields
}

func NewEventQueue

func NewEventQueue(c chan Events, flushThreshold int, flushInterval time.Duration, eventsFlushed prometheus.Counter) *EventQueue

func (*EventQueue) Flush

func (eq *EventQueue) Flush()

func (*EventQueue) FlushUnlocked

func (eq *EventQueue) FlushUnlocked()

func (*EventQueue) Len

func (eq *EventQueue) Len() int

func (*EventQueue) Queue

func (eq *EventQueue) Queue(events Events)

type Events

type Events []Event

type GaugeEvent

type GaugeEvent struct {
	GMetricName string
	GValue      float64
	GRelative   bool
	GLabels     map[string]string
}

func (*GaugeEvent) Labels

func (g *GaugeEvent) Labels() map[string]string

func (*GaugeEvent) MetricName

func (g *GaugeEvent) MetricName() string

func (*GaugeEvent) MetricType

func (g *GaugeEvent) MetricType() mapper.MetricType

func (*GaugeEvent) Value

func (g *GaugeEvent) Value() float64

type ObserverEvent added in v0.17.0

type ObserverEvent struct {
	OMetricName string
	OValue      float64
	OLabels     map[string]string
}

func (*ObserverEvent) Labels added in v0.17.0

func (o *ObserverEvent) Labels() map[string]string

func (*ObserverEvent) MetricName added in v0.17.0

func (o *ObserverEvent) MetricName() string

func (*ObserverEvent) MetricType added in v0.17.0

func (o *ObserverEvent) MetricType() mapper.MetricType

func (*ObserverEvent) Value added in v0.17.0

func (o *ObserverEvent) Value() float64

type UnbufferedEventHandler

type UnbufferedEventHandler struct {
	C chan Events
}

func (*UnbufferedEventHandler) Queue

func (ueh *UnbufferedEventHandler) Queue(events Events)

Jump to

Keyboard shortcuts

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