livery.workshop._footprint¶
livery.workshop._footprint ¶
The runner footprint: the runner-minutes the metrics window holds, by runner label.
What fm ci.footprint prints. Each row of the metrics series
(livery.workshop._metrics.SERIES) is one run with the forge's wall
time of every job. A job whose display name lists its matrix, check
(macos-latest, 3.14) or check (windows-latest, 3.14, 2of4), ran
on the runner the first item names; every other job (the gate job, the
docs build, the release jobs, the matrix picker) ran on the first
runner [ci] runners names, where the workflow places them. The
folded row of a platform's shards is left out: the forge never ran it,
and the shards' own rows carry the minutes. A job without a wall time,
still running when the gate job collected or never started, is counted
apart and priced as nothing.
The price is GitHub's, for the standard runners of a private
repository; fm ci.footprint decides when to print it. A public
repository on GitHub is not billed for them, so the price says what
the same minutes would cost a private one.
Classes:
| Name | Description |
|---|---|
Line |
The jobs and minutes of one kind on one runner label. |
Footprint |
The runner-minutes of a window of runs, by runner label and kind. |
Functions:
| Name | Description |
|---|---|
runner_class |
The class label names: |
runner_of |
The runner label the job display ran on, and the kind of line it counts in. |
footprint |
Sum the runner-minutes of entries, the rows of a window of runs. |
default_runner |
The first runner the root contract's |
render |
The footprint as |
price |
The footprint priced at GitHub's rates for a private repository, as printed. |
Attributes:
| Name | Type | Description |
|---|---|---|
RATES |
Mapping[str, float]
|
|
SOURCE |
|
|
LEGS |
|
|
OTHER |
|
RATES
module-attribute
¶
SOURCE
module-attribute
¶
Line
dataclass
¶
The jobs and minutes of one kind on one runner label.
Attributes:
| Name | Type | Description |
|---|---|---|
label |
str
|
The runner label, |
kind |
str
|
|
jobs |
int
|
How many jobs with a wall time the line sums. |
minutes |
float
|
Their summed wall time in minutes. |
Footprint
dataclass
¶
Footprint(runs: int, first_day: str, last_day: str, span_days: float, lines: tuple[Line, ...], untimed: int)
The runner-minutes of a window of runs, by runner label and kind.
Attributes:
| Name | Type | Description |
|---|---|---|
runs |
int
|
How many runs the window holds. |
first_day |
str
|
The day of the oldest run, ISO; empty when no run says when it was created. |
last_day |
str
|
The day of the newest run, ISO; empty likewise. |
span_days |
float
|
The days from the oldest run to the newest, at least one: the rate per 30 days divides by it. |
lines |
tuple[Line, ...]
|
One per runner label and kind, by label then kind. |
untimed |
int
|
The jobs without a wall time, counted apart. |
Methods:
| Name | Description |
|---|---|
per_30_days |
value, a total over the window, as a rate per 30 days. |
per_30_days ¶
runner_class ¶
The class label names: linux, windows, macos, or empty.
By substring of the lowercased label: ubuntu or linux is
linux, windows is windows, macos is macos. A label naming
none, a self-hosted runner's say, is empty, and prices as nothing.
Source code in packages/workshop/src/livery/workshop/_footprint.py
runner_of ¶
The runner label the job display ran on, and the kind of line it counts in.
A matrix job, check (macos-latest, 3.14) or check
(windows-latest, 3.14, 2of4), ran on the first item in its
parentheses and counts as LEGS. Every other display name ran on
default and counts as OTHER.
Source code in packages/workshop/src/livery/workshop/_footprint.py
footprint ¶
Sum the runner-minutes of entries, the rows of a window of runs.
Every job of every row is counted on one runner label, as
runner_of attributes it with default_runner; a fold's own row
is left out, since the shards' rows carry its minutes. A job whose
wall_ms is no number is counted apart. The span is from the
oldest row's creation to the newest, at least one day; a row that
says no moment is left out of it.
Source code in packages/workshop/src/livery/workshop/_footprint.py
default_runner ¶
The first runner the root contract's [ci] runners names.
ubuntu-latest when the contract names none, as the workflow
renders it.
Source code in packages/workshop/src/livery/workshop/_footprint.py
render ¶
The footprint as fm ci.footprint prints it: the window, a table, the rate.
The window line gives the runs, the days and the span. One table line per runner label and kind, the total, and a line for the jobs without a wall time when there are any. Then the minutes per 30 days from the span.
Source code in packages/workshop/src/livery/workshop/_footprint.py
price ¶
The footprint priced at GitHub's rates for a private repository, as printed.
Only for a public repository on GitHub, which is not billed for standard runners: the table says what the same minutes would cost a private one, one line per runner label and kind at its class's rate, a label of no class named as unpriced, then the total, the USD per 30 days, and the source page.