log_streamer

package
v0.0.0-...-3868529 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

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

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

Types

type ConcurrentBuffer

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

func NewConcurrentBuffer

func NewConcurrentBuffer(payload *bytes.Buffer) *ConcurrentBuffer

func (*ConcurrentBuffer) Read

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

func (*ConcurrentBuffer) Reset

func (b *ConcurrentBuffer) Reset()

func (*ConcurrentBuffer) Write

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

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