logkeeper

package module
v0.0.0-...-15df1d5 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 47 Imported by: 3

README

To set up and run (be sure to have a mongod instance running on localhost on the default port):

    git clone git@github.com:evergreen-ci/logkeeper
    cd logkeeper
    
    # Use this (or similar command) to seed some sample data into a local bucket and use that as storage
    mkdir -p _bucketdata && cp -r testdata/simple/* _bucketdata
    go run main/logkeeper.go --localPath _bucketdata

Example of running resmoke with logkeeper

# Run this from the root directory where mongodb is cloned to:
python buildscripts/resmoke.py --suites=core --log=buildlogger  --buildloggerUrl="http://localhost:8080"

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuildRevision = "-dev"

BuildRevision Should be specified with -ldflags at build time

View Source
var Colors = []string{"#333", "seagreen", "steelblue",
	"mediumpurple", "crimson", "darkkhaki",
	"darkgreen", "rosybrown", "chocolate",
	"orangered", "darkseagreen", "royalblue",
	"slategray",
}
View Source
var ErrReadSizeLimitExceeded = errors.New("read size limit exceeded")

Functions

func BackgroundLogging

func BackgroundLogging(ctx context.Context)

func Close

func Close(ctx context.Context)

func GetSender

func GetSender(ctx context.Context, fn string) (send.Sender, error)

func LoadTraceProvider

func LoadTraceProvider(ctx context.Context, collectorEndpoint string, sampleRatio float64) error

func NewLogkeeper

func NewLogkeeper(opts LogkeeperOptions) *logkeeper

NewLogkeeper returns a new Logkeeper REST service with the given options.

func NewPProfSvc

func NewPProfSvc() *pprofsvc

Types

type ColorDef

type ColorDef struct {
	Name  string
	Color string
}

type ColorSet

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

ColorSet is a structure to track unique logger names and assign a color number to each one.

func NewColorSet

func NewColorSet() *ColorSet

func (*ColorSet) GetAllColors

func (self *ColorSet) GetAllColors() []ColorDef

GetAllColors returns a list of all the ColorDef entries stored internally, where each ColorDef is composed of a name and actual HTML color value.

func (*ColorSet) GetColor

func (self *ColorSet) GetColor(inputKey interface{}) (string, error)

GetColor returns a unique color name for the given key, creating a new one in its internal map if it does not already exist.

type LimitedReader

type LimitedReader struct {
	R io.Reader // underlying reader
	N int       // max bytes remaining
}

A LimitedReader reads from R but limits the amount of data returned to just N bytes. Each call to Read updates N to reflect the new amount remaining. Note: this is identical to io.LimitedReader, but returns ErrReadSizeLimitExceeded so it can be distinguished from a normal EOF.

func (*LimitedReader) Read

func (l *LimitedReader) Read(p []byte) (n int, err error)

Read returns an error if the bytes in the reader exceed the maximum size threshold for the reader, but fail to

type Logger

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

Logger is a middleware handler that aggregates statistics on responses. Route statistics are periodically logged. If a handler panics Logger will recover the panic and log its error.

func NewLogger

func NewLogger(ctx context.Context) *Logger

NewLogger returns a new Logger instance and starts its background goroutines.

func (*Logger) Middleware

func (l *Logger) Middleware(next http.Handler) http.Handler

Middleware returns a handler that incorporates the response into its response cache. If next panics the panic is recovered and logged.

type LogkeeperOptions

type LogkeeperOptions struct {
	// URL is the base URL to append to relative paths.
	URL string
	// MaxRequestSize is the maximum allowable request size.
	MaxRequestSize int
}

LogkeeperOptions represents the set of options for creating a new Logkeeper REST service.

type MutableVar

type MutableVar struct {
	Value interface{}
}

func (*MutableVar) Get

func (self *MutableVar) Get() interface{}

func (*MutableVar) Set

func (self *MutableVar) Set(v interface{}) interface{}

Directories

Path Synopsis
buildscripts
make-tarball
Archive
Archive

Jump to

Keyboard shortcuts

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