Documentation ¶
Index ¶
- Constants
- Variables
- func CleanupOldLogsByBuild(id interface{}) (int, error)
- func GetCtxRequestId(r *http.Request) int
- func GetHandlerPprof() http.Handler
- func GetSender(queue amboy.Queue, fn string) (send.Sender, error)
- func IsLeader() bool
- func MergeLog(logger1 chan *LogLineItem, logger2 chan *LogLineItem) chan *LogLineItem
- func New(opts Options) *logKeeper
- func SetCtxRequestId(reqID int, r *http.Request) *http.Request
- func StartBackgroundLogging(ctx context.Context)
- func StreamingGetOldTests(ctx context.Context, timeout time.Duration) (<-chan Test, <-chan error)
- func UpdateFailedTestsByBuildID(id interface{}) (int, error)
- type ColorDef
- type ColorSet
- type LimitedReader
- type Log
- type LogKeeperBuild
- type LogLine
- type LogLineItem
- type Logger
- type MutableVar
- type Options
- type Test
Constants ¶
const ( CleanupFactor = 5 CleanupBatchSize = 30000 * CleanupFactor AmboyInterval = time.Minute * CleanupFactor AmboyWorkers = 8 AmboyTargetNumJobs = CleanupBatchSize AmboyDBName = "amboy" AmboyMigrationQueueName = "logkeeper.etl" AmboyLeaderFile = "/srv/logkeeper/amboy.leader" )
Variables ¶
var BuildRevision = "-dev"
Should be specified with -ldflags at build time
var Colors = []string{"#333", "seagreen", "steelblue",
"mediumpurple", "crimson", "darkkhaki",
"darkgreen", "rosybrown", "chocolate",
"orangered", "darkseagreen", "royalblue",
"slategray",
}
var ErrReadSizeLimitExceeded = errors.New("read size limit exceeded")
Functions ¶
func CleanupOldLogsByBuild ¶
func GetCtxRequestId ¶
func GetHandlerPprof ¶
GetHandlerPprof returns a handler for pprof endpoints.
func MergeLog ¶
func MergeLog(logger1 chan *LogLineItem, logger2 chan *LogLineItem) chan *LogLineItem
MergeLog takes two channels of LogLineItem and returns a single channel that feeds the result of merging the two input channels sorted by timestamp.
func StartBackgroundLogging ¶
func StreamingGetOldTests ¶
Types ¶
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 ¶
GetAllColors returns a list of all the ColorDef entries stored internally, where each ColorDef is composed of a name and actual HTML color value.
type LimitedReader ¶
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 throws ErrReadSizeLimitExceeded so it can be distinguished from a normal EOF.
type LogKeeperBuild ¶
type LogLine ¶
type LogLine []interface{}
func NewLogLine ¶
func NewLogLine(data []interface{}) *LogLine
type LogLineItem ¶
func (*LogLineItem) Color ¶
func (self *LogLineItem) Color() string
func (LogLineItem) Global ¶
func (lli LogLineItem) Global() bool
Global returns true if this log line comes from a global log, otherwise false (from a test log).
func (*LogLineItem) OlderThanThreshold ¶
func (self *LogLineItem) OlderThanThreshold(previousItem interface{}) bool
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
is a middleware handler that logs the request as it goes in and the response as it goes out.
func (*Logger) ServeHTTP ¶
func (l *Logger) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
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{}
type Test ¶
type Test struct { Id bson.ObjectId `bson:"_id"` BuildId interface{} `bson:"build_id"` BuildName string `bson:"build_name"` Name string `bson:"name"` Command string `bson:"command"` Started time.Time `bson:"started"` Ended *time.Time `bson:"ended"` Info map[string]interface{} `bson:"info"` Failed bool `bson:"failed"` Phase string `bson:"phase"` Seq int `bson:"seq"` }
func GetOldTests ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Archive Provides a single "MakeTarball" function to create tar (tar.gz) archives.
|
Archive Provides a single "MakeTarball" function to create tar (tar.gz) archives. |
vendoring
Package vendoring provides a several variables used in vendoring buildscripts and function that reports (without any external dependencies) if the current environment requires legacy-style vendoring, or if its safe to use new-style vendoring.
|
Package vendoring provides a several variables used in vendoring buildscripts and function that reports (without any external dependencies) if the current environment requires legacy-style vendoring, or if its safe to use new-style vendoring. |