metrics

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDuration

func FormatDuration(d time.Duration) string

FormatDuration renders a duration in a human-friendly way.

func FormatSpecSummary

func FormatSpecSummary(sm *SpecMetrics) string

FormatSpecSummary renders a human-readable summary of a spec's journey.

Types

type PipelineMetrics

type PipelineMetrics struct {
	SpecsCompleted  int
	AvgTimePerStage map[string]time.Duration
	ReversionRate   float64
	BottleneckStage string
	SpecsPerStage   map[string]int
	TotalAdvances   int
	TotalReversions int
}

PipelineMetrics holds computed metrics for a cycle or time window.

func Compute

func Compute(entries []store.ActivityEntry, specsByStage map[string]int, stageNames []string, terminalStages []string) *PipelineMetrics

Compute calculates pipeline metrics from activity entries and current spec distribution. Note: specsByStage is collected at query time, separate from activity history. In a live system, specs may advance between loading the activity log and scanning specs, causing off-by-one discrepancies in SpecsPerStage counts. This is acceptable for approximate metrics over a time window — exact consistency is not required.

type SpecMetrics

type SpecMetrics struct {
	SpecID        string
	StagesVisited []string
	TimePerStage  map[string]time.Duration
	TotalTime     time.Duration
	Reversions    int
	Ejections     int
}

SpecMetrics holds computed metrics for a single spec's journey.

func ComputeForSpec

func ComputeForSpec(specID string, allEntries []store.ActivityEntry) *SpecMetrics

ComputeForSpec calculates per-spec metrics from activity entries.

Jump to

Keyboard shortcuts

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