taskoutput

package
v0.0.0-...-e25005f Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EvergreenSenderOptions

type EvergreenSenderOptions struct {
	// LevelInfo configures the sender's log levels. Defaults the default
	// and threshold log levels to "trace".
	LevelInfo send.LevelInfo
	// Local is the sender for "fallback" operations and to collect any
	// logger error output. Defaults to stdout.
	Local send.Sender
	// MaxBufferSize is the maximum number of bytes to buffer before
	// persisting log data. Defaults to 10MB.
	MaxBufferSize int
	// FlushInterval is time interval at which to flush log lines,
	// regardless of whether the max buffer size has been reached. A flush
	// interval equal to 0 will disable timed flushes.
	FlushInterval time.Duration
	// Parse is the injectable line parser that allows the sender to be
	// agnostic to the raw log line formats it ingests. Defaults to a basic
	// line parser that adds the raw string as the log line data field.
	Parse LogLineParser
	// contains filtered or unexported fields
}

EvergreenSenderOptions support the use and creation of an Evergreen sender.

type LogLineParser

type LogLineParser func(string) (log.LogLine, error)

LogLineParser functions parse a raw log line into the service representation of a log line for uniform ingestion of logs by the Evergreen log sender. Parsers need not set the log name or, in most cases, the priority.

type TaskLogGetOptions

type TaskLogGetOptions struct {
	// LogType is the type of task log to fetch. Must be a valid task log
	// type.
	LogType TaskLogType
	// Start is the start time (inclusive) of the time range filter,
	// represented as a Unix timestamp in nanoseconds. Defaults to
	// unbounded.
	Start *int64
	// End is the end time (inclusive) of the time range filter,
	// represented as a Unix timestamp in nanoseconds. Defaults to
	// unbounded.
	End *int64
	// LineLimit limits the number of lines read from the log. Ignored if
	// less than or equal to 0.
	LineLimit int
	// TailN is the number of lines to read from the tail of the log.
	// Ignored if less than or equal to 0.
	TailN int
}

TaskLogGetOptions represents the arguments for fetching task logs belonging to a task run.

type TaskLogOutput

type TaskLogOutput struct {
	Version      int                    `bson:"version" json:"version"`
	BucketConfig evergreen.BucketConfig `bson:"bucket_config" json:"bucket_config"`

	AWSCredentials aws.CredentialsProvider `bson:"-" json:"-"`
}

TaskLogOutput is the versioned entry point for coordinating persistent storage of a task run's task log data.

func (TaskLogOutput) Append

func (o TaskLogOutput) Append(ctx context.Context, taskOpts TaskOptions, logType TaskLogType, lines []log.LogLine) error

Append appends log lines to the specified task log for the given task run.

func (TaskLogOutput) Get

Get returns task logs belonging to the specified task run.

func (TaskLogOutput) ID

func (TaskLogOutput) ID() string

ID returns the unique identifier of the task log output type. Note that this is distinct from the task log output type subtype `task_log`.

func (TaskLogOutput) NewSender

func (o TaskLogOutput) NewSender(ctx context.Context, taskOpts TaskOptions, senderOpts EvergreenSenderOptions, logType TaskLogType) (send.Sender, error)

NewSender returns a new task log sender for the given task run.

type TaskLogType

type TaskLogType string

TaskLogType represents the recognized types of task logs.

const (
	TaskLogTypeAll    TaskLogType = "all_logs"
	TaskLogTypeAgent  TaskLogType = "agent_log"
	TaskLogTypeSystem TaskLogType = "system_log"
	TaskLogTypeTask   TaskLogType = "task_log"
)

func (TaskLogType) Validate

func (t TaskLogType) Validate(writing bool) error

type TaskOptions

type TaskOptions struct {
	// ProjectID is the project ID of the task run.
	ProjectID string `bson:"-" json:"-"`
	// TaskID is the task ID of the task run.
	TaskID string `bson:"-" json:"-"`
	// Execution is the execution number of the task run.
	Execution int `bson:"-" json:"-"`
}

TaskOptions represents the task-level information required for accessing task logs belonging to a task run.

type TaskOutput

type TaskOutput struct {
	TaskLogs TaskLogOutput `bson:"task_logs,omitempty" json:"task_logs"`
	TestLogs TestLogOutput `bson:"test_logs,omitempty" json:"test_logs"`
}

TaskOutput is the versioned entry point for coordinating persistent storage of a task run's output data.

func InitializeTaskOutput

func InitializeTaskOutput(env evergreen.Environment) *TaskOutput

InitializeTaskOutput initializes the task output for a new task run.

type TestLogGetOptions

type TestLogGetOptions struct {
	// LogPaths are the paths of the logs to fetch and merge, prefixes may
	// be specified. At least one value must be specified.
	LogPaths []string
	// Start is the start time (inclusive) of the time range filter,
	// represented as a Unix timestamp in nanoseconds. Defaults to the
	// first timestamp of the first specified log.
	Start *int64
	// End is the end time (inclusive) of the time range filter,
	// represented as a Unix timestamp in nanoseconds. Defaults to the last
	// timestamp of the first specified log.
	End *int64
	// LineLimit limits the number of lines read from the log. Ignored if
	// less than or equal to 0.
	LineLimit int
	// TailN is the number of lines to read from the tail of the log.
	// Ignored if less than or equal to 0.
	TailN int
}

TestLogGetOptions represents the arguments for fetching test logs belonging to a task run.

type TestLogOutput

type TestLogOutput struct {
	Version      int                    `bson:"version" json:"version"`
	BucketConfig evergreen.BucketConfig `bson:"bucket_config" json:"bucket_config"`

	AWSCredentials aws.CredentialsProvider `bson:"-" json:"-"`
}

TestLogOutput is the versioned entry point for coordinating persistent storage of a task run's test log data.

func (TestLogOutput) Append

func (o TestLogOutput) Append(ctx context.Context, taskOpts TaskOptions, logPath string, lines []log.LogLine) error

Append appends log lines to the specified test log for the given task run.

func (TestLogOutput) Get

Get returns test logs belonging to the specified task run.

func (TestLogOutput) ID

func (TestLogOutput) ID() string

ID returns the unique identifier of the test log output type.

func (TestLogOutput) NewSender

func (o TestLogOutput) NewSender(ctx context.Context, taskOpts TaskOptions, senderOpts EvergreenSenderOptions, logPath string) (send.Sender, error)

NewSender returns a new test log sender for the given task run.

Jump to

Keyboard shortcuts

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