Documentation ¶
Overview ¶
Package compilerproxylog provides compiler_proxy INFO log parser.
Index ¶
- Constants
- func ClassifyByCompileMode(tl []*TaskLog) [NumCompileMode][]*TaskLog
- func ClassifyByResponse(tl []*TaskLog) map[string][]*TaskLog
- func DurationDistribution(st time.Time, tl []*TaskLog) []time.Duration
- type ByDuration
- type ByPending
- type ByRunDuration
- type CompileMode
- type CompilerProxyLog
- type GlogParser
- type HTTPError
- type LogLevel
- type Logline
- type TaskLog
- type TaskLogs
Constants ¶
const ( // Compiling is normal compiling (-c). Compiling CompileMode = iota // Precompiling is precompiling header (-c for header). Precompiling // Linking is other compilation mode. Linking // NumCompileMode is number of CompilerMode. NumCompileMode int = iota )
Variables ¶
This section is empty.
Functions ¶
func ClassifyByCompileMode ¶
func ClassifyByCompileMode(tl []*TaskLog) [NumCompileMode][]*TaskLog
ClassifyByCompileMode classifies TaskLog by CompileMode.
func ClassifyByResponse ¶
ClassifyByResponse classifies TaskLog by response.
Types ¶
type ByDuration ¶
type ByDuration struct{ TaskLogs }
ByDuration sorts a list of TaskLogs by duration.
func (ByDuration) Less ¶
func (tl ByDuration) Less(i, j int) bool
Less is used to sort a list of TaskLogs by Duration.
type ByRunDuration ¶
type ByRunDuration struct{ TaskLogs }
ByRunDuration sorts a list of TaskLogs by run duration.
func (ByRunDuration) Less ¶
func (tl ByRunDuration) Less(i, j int) bool
Less is used to sort a list of TaskLogs by RunDuration.
type CompileMode ¶
type CompileMode int
CompileMode is mode of compilation.
func (CompileMode) String ¶
func (cm CompileMode) String() string
type CompilerProxyLog ¶
type CompilerProxyLog struct { // Filename is a filename of the compiler_proxy INFO log. Filename string // Created is a timestamp when the compiler_proxy INFO log was created. Created time.Time // Closed is a timestamp when the compiler_proxy INFO log was closed. Closed time.Time // Machine is a machine where the compiler_proxy INFO log was created. Machine string // GomaRevision is goma revision of the compiler_proxy. GomaRevision string // GomaVersion is goma version of the compiler_proxy if it is released one. GomaVersion string // CompilerProxyIDPrefix is compiler_proxy_id prefix. CompilerProxyIDPrefix string // BuildIDs is build_id appeared in compiler_proxy log. // on bot, it will be one build id. BuildIDs []string // GomaFlags is goma configuration flags. GomaFlags string // GomaLimits is goma limits. GomaLimits string // CrashDump is crash dump filename if any. CrashDump string // Stats is compiler_proxy stats. Stats string // Histogram is compiler_proxy histogram. Histogram string // HTTPErrors is http errors detected in compiler proxy log. // value is task id. HTTPErrors map[HTTPError][]string // contains filtered or unexported fields }
CompilerProxyLog represents parsed compiler_proxy INFO log.
func Parse ¶
func Parse(fname string, rd io.Reader) (*CompilerProxyLog, error)
Parse parses compiler_proxy.
func (*CompilerProxyLog) Duration ¶
func (cpl *CompilerProxyLog) Duration() time.Duration
Duration returns duration of running time of compiler_proxy.
func (*CompilerProxyLog) TaskLogs ¶
func (cpl *CompilerProxyLog) TaskLogs() []*TaskLog
TaskLogs reports TaskLogs sorted by task id.
type GlogParser ¶
type GlogParser struct { // Created is a timestamp when the log file is created. Created time.Time // Machine is a machine name where the log file is created. Machine string // contains filtered or unexported fields }
GlogParser is a parser of glog.
func NewGlogParser ¶
func NewGlogParser(rd io.Reader) (*GlogParser, error)
NewGlogParser creates new GlogParser on rd.
func (*GlogParser) Logline ¶
func (gp *GlogParser) Logline() Logline
Logline returns last Logline parsed by Next().
func (*GlogParser) Next ¶
func (gp *GlogParser) Next() bool
Next scans next Logline. return true if Logline exists.
type LogLevel ¶
type LogLevel int
LogLevel is glog logging level.
const ( // Info is INFO level. Info LogLevel // Warning is WARNING level. Warning // Error is ERROR level. Error // Fatal is FATAL level. Fatal )
type Logline ¶
type Logline struct { // Level is logging level. Level LogLevel // Timestamp is time of log. Timestamp time.Time // ThreadID is thread id. ThreadID string // Lines is log text lines. len(Lines) >= 1. Lines []string }
Logline is one logical log line.
func ParseLogline ¶
ParseLogline parses one line as Logline.
type TaskLog ¶
type TaskLog struct { // ID is task id. ID string // BuildID is build id for the task. BuildID string // Desc is task description. (e.g. input_filename). Desc string // CompileMode is compile mode of the task. CompileMode CompileMode // AcceptTime is a time when this task is accepted by compiler_proxy. AcceptTime time.Time // StartTime is a time when compiler_proxy started to handle this task. StartTime time.Time // EndTime is a time when compiler_proxy finished to handle this task. EndTime time.Time // Logs are logs associated with the task. Logs []Logline // HTTPErrors are http errors happened in the task. HTTPErrors []HTTPError // Response is a response type of the task. (e.g. "goma success"). Response string }
TaskLog is a Task's log.
func (*TaskLog) RunDuration ¶
RunDuration is task duration of CompileTask.