Documentation
¶
Overview ¶
Package deploys records deployment markers — a timestamped point ("this shipped then") you overlay on any metric to answer the one question every other analytics tool leaves you guessing: did that deploy move the number? Markers are cheap to record (a git sha + message from CI, or a named release by hand); the impact math lives in impact.go and is the same trends engine the dashboard renders, so the answer is computed, never guessed, and a CI test pins it to the dashboard.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Deploy ¶
type Deploy struct {
ID string `json:"id"`
SHA string `json:"sha,omitempty"`
Message string `json:"message,omitempty"`
Author string `json:"author,omitempty"`
Ref string `json:"ref,omitempty"`
URL string `json:"url,omitempty"`
Source string `json:"source,omitempty"` // github | ci | cli | manual
At time.Time `json:"at"` // when it shipped (the marker time)
Created time.Time `json:"created"` // when it was recorded here
}
Deploy is one recorded release. Identity is the git SHA when present (so re-recording the same commit upserts instead of duplicating — the cloud syncs every commit on each dashboard load); a marker without a SHA is a distinct manual entry.
type Impact ¶
type Impact struct {
Deploy
ShortSHA string `json:"short_sha"`
Before *float64 `json:"before"`
After *float64 `json:"after"`
DeltaPct *float64 `json:"delta_pct"`
Direction string `json:"direction"` // regression | improvement | flat | unknown
Significant bool `json:"significant"`
}
Impact is one deploy with its measured before/after effect on a metric. Nullable fields use pointers so they serialize as JSON null (not 0) when there isn't enough data — a missing number must never read as "zero change".
func ComputeImpact ¶
ComputeImpact lines each deploy up against a daily metric series and compares the mean of the `window` days AFTER the deploy against the `window` days BEFORE. This is correlation, not proof, so a deploy is only flagged Significant when BOTH windows are fully populated AND the move is at least `threshold` (e.g. 0.25). Returned newest-first.
type Point ¶
Point is one day of a metric series (mirrors trends.Point; the api/mcp layer converts so this package stays dependency-free and the impact math is a pure, testable leaf).
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a small persisted list of deploy markers. Same shape + persistence as the goal / share stores: JSON on disk, atomic tmp+rename, one mutex, List returns a copy.
func Open ¶
Open loads the store from p, or returns an empty store if the file doesn't exist. An empty path means in-memory only (demo mode writes nothing to the visitor's disk).