Documentation
¶
Overview ¶
Package runrecord formats and reads the run.start / run.end / run.fallback events every beekeeper run writes to the event log, local and remote alike: one record shape, so `beekeeper log --verb run.` and `beekeeper run stats` count builds, their minutes and their failures whichever slot they ran in. The formatter is a leaf package: internal/guard and internal/remotebuild both use it, and guard imports remotebuild, so neither may hold the shared shape.
The detail of a start is "<id><facts>: <command>", of an end "<id> exit <code> after <duration>[, <extra>]: <command>". The id says where the run ran: a local one names its scope's unit exactly as the kernel prints it in an OOM kill's memcg path (memcap-…, memcap-test-…), a remote one remote:<pod>.<run>. The facts of a start name what was built (the repository and HEAD) and, remotely, the builder pod's namespace and cache; the extra of an end names the cap's victims of a local run or the failure's tail of a remote one. A remote attempt that gives up before the command starts records a fallback with its reason; the local slot's own start and end then follow under the local id.
Index ¶
- Constants
- func Cache(warm bool, namespace string) string
- func EndDetail(id string, rc int, took time.Duration, extra, command string) string
- func Facts(repo, head string) string
- func FallbackDetail(facts, reason, command string) string
- func ID(detail string) string
- func OneLine(s string) string
- func ParseEnd(detail string) (rc int, took time.Duration, ok bool)
- func Remote(detail string) bool
- func RemoteID(pod, run string) string
- func Repository(detail string) string
- func StartDetail(id, facts, command string) string
- func Warm(detail string) (warm, ok bool)
Constants ¶
const ( Start = "run.start" End = "run.end" Fallback = "run.fallback" )
The event log verbs of a run.
const RemotePrefix = "remote:"
RemotePrefix starts the id of a run that ran in a builder pod.
Variables ¶
This section is empty.
Functions ¶
func Cache ¶
Cache is the builder pod's cache state a remote run.start names: warm for a reused pod whose build caches hold earlier runs, cold for one created for this run, with the pod's namespace. The shared cache (issue #1782) reports its hits here.
func EndDetail ¶
EndDetail is a run.end's detail: "<id> exit <code> after <duration>[, <extra>]: <command>". extra names the cap's victims of a local run, or a remote one's failure tail.
func Facts ¶
Facts is the repository and HEAD a run.start names — what was built — "" where either is unknown.
func FallbackDetail ¶
FallbackDetail is a run.fallback's detail: a remote attempt that gave up before the command started, naming why; the local slot ran the command.
func OneLine ¶
OneLine folds a multi-line text (a failed run's tail) onto one line: the event log prints one event per line.
func ParseEnd ¶
ParseEnd reads an end detail: the exit code and the duration between the run's start and its record. false when the detail is none (an event written by another verb or an older format).
func RemoteID ¶
RemoteID is the id a remote run's events name: remote:<pod>.<run>. It carries no ": " (the command follows the detail's first one) and no space (the id is the detail's first field).
func Repository ¶
Repository is the owner/repo the detail's first fact names — every writer puts it right after the id — "" where none is there (a record of an older release, or a run outside a GitHub worktree). Only the first fact is read: a failed remote run's tail is output, and its text is no repository.
func StartDetail ¶
StartDetail is a run.start's detail: "<id><facts>: <command>".
func Warm ¶
Warm is the reader of Cache: whether a run.start's facts — read before the command delimiter, never from the command or a failed run's tail, which hold arbitrary text — say the builder pod's build caches held earlier runs. ok is false when the record names no cache: a local run's, an end's, or a record of an older release.
Types ¶
This section is empty.