event

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2020 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 (c *GaugeEvent) Labels() map[string]string

func (*GaugeEvent) MetricName

func (g *GaugeEvent) MetricName() string

func (*GaugeEvent) MetricType

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

func (*GaugeEvent) Value

func (g *GaugeEvent) Value() float64

type TimerEvent

type TimerEvent struct {
	TMetricName string
	TValue      float64
	TLabels     map[string]string
}

func (*TimerEvent) Labels

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

func (*TimerEvent) MetricName

func (t *TimerEvent) MetricName() string

func (*TimerEvent) MetricType

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

func (*TimerEvent) Value

func (t *TimerEvent) 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