truncatingbuffer

package
v74.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2017 License: Apache-2.0, BSD-3-Clause, MIT Imports: 9 Imported by: 0

README

truncatingbuffer

truncatingbuffer is a buffering library used in a number of places in Loggregator to provide "circuit breaking" when encountering back pressure from a TCP link to a downstream consumer (Doppler, Metron, etc).

In Jan 2016 the Loggregator team had concerns about the performance of this library and did a charter story to explore. The team found that the performance was very high, on the order of 1M dropsonde messages/sec on a Macbook Pro local deployment. Full details are in the story here.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferContext

type BufferContext interface {
	EventAllowed(events.Envelope_EventType) bool
	Destination() string
	Origin() string
	AppID(*events.Envelope) string
}

type DefaultContext

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

func NewDefaultContext

func NewDefaultContext(origin string, destination string) *DefaultContext

func (*DefaultContext) AppID

func (d *DefaultContext) AppID(envelope *events.Envelope) string

func (*DefaultContext) Destination

func (d *DefaultContext) Destination() string

func (*DefaultContext) EventAllowed

func (d *DefaultContext) EventAllowed(events.Envelope_EventType) bool

func (*DefaultContext) Origin

func (d *DefaultContext) Origin() string

type LogAllowedContext

type LogAllowedContext struct {
	DefaultContext
}

func NewLogAllowedContext

func NewLogAllowedContext(origin string, destination string) *LogAllowedContext

func (*LogAllowedContext) EventAllowed

func (l *LogAllowedContext) EventAllowed(event events.Envelope_EventType) bool

type SystemContext

type SystemContext struct {
	DefaultContext
}

func NewSystemContext

func NewSystemContext(origin string, destination string) *SystemContext

func (*SystemContext) AppID

func (s *SystemContext) AppID(*events.Envelope) string

type TruncatingBuffer

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

func NewTruncatingBuffer

func NewTruncatingBuffer(inputChannel <-chan *events.Envelope, bufferSize uint, context BufferContext, stopChannel chan struct{}) *TruncatingBuffer

func (*TruncatingBuffer) GetOutputChannel

func (r *TruncatingBuffer) GetOutputChannel() <-chan *events.Envelope

func (*TruncatingBuffer) Run

func (r *TruncatingBuffer) Run()

Jump to

Keyboard shortcuts

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