log_streamer

package
v0.1442.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 14 Imported by: 6

Documentation

Index

Constants

View Source
const (
	AppInstanceExceededLogRateLimitCount = "AppInstanceExceededLogRateLimitCount"
	LogRateLimitExceededLogInterval      = time.Second
)
View Source
const (
	MAX_MESSAGE_SIZE = 61440

	DefaultLogSource = "LOG"
)

Variables

This section is empty.

Functions

func NewLogRateLimiter added in v0.1442.0

func NewLogRateLimiter(
	ctx context.Context,
	metronClient loggingclient.IngressClient,
	tags map[string]string,
	maxLogLinesPerSecond int,
	maxLogBytesPerSecond int64,
	logMetricsEmitInterval time.Duration,
) *logRateLimiter

Types

type ConcurrentBuffer added in v0.1442.0

type ConcurrentBuffer struct {
	Buffer *bytes.Buffer
	*sync.Mutex
}

func NewConcurrentBuffer added in v0.1442.0

func NewConcurrentBuffer(payload *bytes.Buffer) *ConcurrentBuffer

func (*ConcurrentBuffer) Read added in v0.1442.0

func (b *ConcurrentBuffer) Read(buf []byte) (int, error)

func (*ConcurrentBuffer) Reset added in v0.1442.0

func (b *ConcurrentBuffer) Reset()

func (*ConcurrentBuffer) Write added in v0.1442.0

func (b *ConcurrentBuffer) Write(buf []byte) (int, error)

type LogStreamer

type LogStreamer interface {
	Stdout() io.Writer
	Stderr() io.Writer

	UpdateTags(map[string]string)
	Flush()

	WithSource(sourceName string) LogStreamer
	SourceName() string

	Stop()
}

func New

func New(config executor.LogConfig, metronClient loggingclient.IngressClient, maxLogLinesPerSecond int, maxLogBytesPerSecond int64, metricReportInterval time.Duration) LogStreamer

func NewBufferStreamer added in v0.1442.0

func NewBufferStreamer(stdout, stderr io.Writer) LogStreamer

func NewNoopStreamer

func NewNoopStreamer() LogStreamer

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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