Documentation
¶
Overview ¶
Package stats aggregates and formats GitHub Actions workflow run statistics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FmtDuration ¶
FmtDuration formats a millisecond duration compactly: "1h 2m", "3m 40s", "12s".
func Percentile ¶
Percentile returns the nearest-rank percentile of a pre-sorted ascending slice. Returns 0 for an empty input.
Types ¶
type JobStats ¶
JobStats is an aggregated p95 duration for a single job across sampled runs.
func SummarizeJobs ¶
SummarizeJobs groups job samples by name and returns per-job p95, sorted slowest-first.
type RunSample ¶
type RunSample struct {
DurationMs int64 // wall-clock (run_started_at → updated_at)
Success bool // conclusion == "success"
FinishedAt string // ISO timestamp the run finished (updated_at)
}
RunSample is one completed workflow run reduced to what stats need.
type WorkflowStats ¶
type WorkflowStats struct {
Name string `json:"name"`
Runs int `json:"runs"`
SuccessRate float64 `json:"successRate"` // 0..1
P50Ms int64 `json:"p50Ms"`
P95Ms int64 `json:"p95Ms"`
MaxMs int64 `json:"maxMs"`
Last *LastRun `json:"last,omitempty"`
// BillableMs is billable GitHub-hosted runner time for the current
// billing cycle (not the --since window), keyed by OS ("UBUNTU",
// "MACOS", "WINDOWS"). Empty for public repos, where minutes are free.
BillableMs map[string]int64 `json:"billableMs,omitempty"`
}
WorkflowStats are aggregated stats for one workflow.
func Summarize ¶
func Summarize(name string, samples []RunSample) WorkflowStats
Summarize aggregates a workflow's run samples. samples is newest-first.
Click to show internal directories.
Click to hide internal directories.