runrecord

package
v0.174.6 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const (
	Start    = "run.start"
	End      = "run.end"
	Fallback = "run.fallback"
)

The event log verbs of a run.

View Source
const RemotePrefix = "remote:"

RemotePrefix starts the id of a run that ran in a builder pod.

Variables

This section is empty.

Functions

func Cache

func Cache(warm bool, namespace string) string

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

func EndDetail(id string, rc int, took time.Duration, extra, command string) string

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

func Facts(repo, head string) string

Facts is the repository and HEAD a run.start names — what was built — "" where either is unknown.

func FallbackDetail

func FallbackDetail(facts, reason, command string) string

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 ID

func ID(detail string) string

ID is the detail's first field: where the run ran.

func OneLine

func OneLine(s string) string

OneLine folds a multi-line text (a failed run's tail) onto one line: the event log prints one event per line.

func ParseEnd

func ParseEnd(detail string) (rc int, took time.Duration, ok bool)

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 Remote

func Remote(detail string) bool

Remote reports whether the detail is a builder pod run's.

func RemoteID

func RemoteID(pod, run string) string

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

func Repository(detail string) string

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

func StartDetail(id, facts, command string) string

StartDetail is a run.start's detail: "<id><facts>: <command>".

func Warm

func Warm(detail string) (warm, ok bool)

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.

Jump to

Keyboard shortcuts

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