dmetrics

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileListener

func NewFileListener(path string) *fileListener

func NewUDPListener

func NewUDPListener(port int) (*udpListener, error)

Types

type Agent

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

func NewAgent

func NewAgent(host Host, statsEndpoint StatsDSink) *Agent

func (*Agent) EmitKey

func (a *Agent) EmitKey(val float32, event ...string)

type Aggregator

type Aggregator struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewAggregator

func NewAggregator(sink metrics.MetricSink, storage Storage, rawEventParser RawEventParser, l Listener) (*Aggregator, error)

func (*Aggregator) NewDistributedEvent

func (a *Aggregator) NewDistributedEvent(ce ClassExtractorFunc, minSize int, ttl time.Duration) DistributedEvent

func (*Aggregator) NumEvents

func (a *Aggregator) NumEvents() uint64

type ClassExtractorFunc

type ClassExtractorFunc func(*Event) []string

type DistributedEvent

type DistributedEvent interface {
	AddGauge(func(Shim, ...Event) (remaining []Event))

	AddKeyEmission(func(Shim, ...Event) (remaining []Event))

	AddCounterInc(func(Shim, ...Event) (remaining []Event))

	AddSample(func(Shim, ...Event) (remaining []Event))
}

type Event

type Event struct {
	Raw       *RawEvent
	Type      string
	Keys      []string
	Value     float32
	Host      string
	Timestamp time.Time
}

func (*Event) String

func (e *Event) String() string

type FileRawEvenParser

type FileRawEvenParser struct {
	MinTS, MaxTs int64
}

func (*FileRawEvenParser) Parse

func (U *FileRawEvenParser) Parse(re *RawEvent) *Event

type Host

type Host string

type Listener

type Listener interface {
	Subscribe() <-chan *RawEvent
}

type Parser

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

func NewParser

func NewParser(rawEventParser RawEventParser, ch <-chan *RawEvent) *Parser

func (*Parser) Read

func (p *Parser) Read() <-chan *Event

type RawEvent

type RawEvent struct {
	Timestamp time.Time
	Payload   string
}

type RawEventParser

type RawEventParser interface {
	Parse(re *RawEvent) *Event
}

type Shim

type Shim interface {
	metrics.MetricSink
}

type SinkInput

type SinkInput struct {
	Key []string
	Val float32
}

type StatsDSink

type StatsDSink string

type Storage

type Storage interface {
	Store(event *Event)
}

type UDPRawEvenParser

type UDPRawEvenParser struct {
}

func (*UDPRawEvenParser) Parse

func (U *UDPRawEvenParser) Parse(re *RawEvent) *Event

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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