queue

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Provide

func Provide() fx.Option

Provide creates an uber/fx option and appends the queue start and stop into the fx lifecycle.

func ProvideMetrics

func ProvideMetrics() fx.Option

ProvideMetrics builds the queue-related metrics and makes them available to the container.

Types

type Config

type Config struct {
	QueueSize  int
	MaxWorkers int
}

Config configures the glaukos queue used to parse incoming events from Caduceus

type EventQueue

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

EventQueue processes incoming events

func (*EventQueue) ParseEvent

func (e *EventQueue) ParseEvent(eventWithTime EventWithTime)

ParseEvent parses the metadata and boot-time of each event and generates metrics.

func (*EventQueue) ParseEvents

func (e *EventQueue) ParseEvents()

ParseEvents goes through the queue and calls ParseEvent on each event in the queue.

func (*EventQueue) Queue

func (e *EventQueue) Queue(eventWithTime EventWithTime) (err error)

Queue attempts to add a message to the queue and returns an error if the queue is full.

func (*EventQueue) Start

func (e *EventQueue) Start()

func (*EventQueue) Stop

func (e *EventQueue) Stop()

type EventWithTime

type EventWithTime struct {
	Event     interpreter.Event
	BeginTime time.Time
}

EventWithTime allows for the tracking of how long an event stays in glaukos's memory.

type Measures

type Measures struct {
	fx.In
	EventsQueueDepth   prometheus.Gauge       `name:"events_queue_depth"`
	EventsCount        *prometheus.CounterVec `name:"events_count"`
	DroppedEventsCount *prometheus.CounterVec `name:"dropped_events_count"`
}

Measures contains the various queue-related metrics.

type Parser

type Parser interface {
	Parse(interpreter.Event)
	Name() string
}

Parser is the interface that all glaukos parsers must implement.

type ParsersIn

type ParsersIn struct {
	fx.In
	Parsers []Parser `group:"parsers"`
}

ParsersIn brings together all of the different types of parsers that glaukos uses.

type Queue

type Queue interface {
	Queue(EventWithTime) error
}

Queue is the type that processes incoming events

type TimeTrackIn

type TimeTrackIn struct {
	fx.In
	TimeInMemory prometheus.Observer `name:"time_in_memory"`
}

type TimeTracker

type TimeTracker interface {
	TrackTime(time.Duration)
}

TimeTracker tracks the time an event is in memory.

type TooManyRequestsErr

type TooManyRequestsErr struct {
	Message string
}

func (TooManyRequestsErr) Error

func (e TooManyRequestsErr) Error() string

func (TooManyRequestsErr) StatusCode

func (e TooManyRequestsErr) StatusCode() int

Jump to

Keyboard shortcuts

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