Documentation
¶
Overview ¶
Package deliverystats computes delivery metrics from deploy history.
A change is a finished deploy of new work; a rollback is a recovery. A change failed when it finished failed or a rollback later replaced it.
Index ¶
Constants ¶
const ( UnknownNoDeploys = "no_finished_deploys" UnknownFewSamples = "not_enough_samples" UnknownNoCommitTime = "commit_time_unknown" UnknownNoFailures = "no_failures" UnknownNotRestored = "not_restored_yet" UnknownWindowTooThin = "window_too_short" )
Reasons a metric has no value.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Attempt ¶
type Attempt struct {
App string
CommitSHA string
Succeeded bool
Rollback bool
FinishedAt time.Time
// CommitAt is zero when the commit time is not known.
CommitAt time.Time
}
Attempt is one finished deploy attempt.
type Metric ¶
type Metric struct {
Value *float64 `json:"value"`
Samples int `json:"samples"`
Unknown string `json:"unknown_reason,omitempty"`
}
Metric has a nil Value when there is not enough data to state one.
type Options ¶
type Options struct {
Since, Until time.Time
// MinSamples is the fewest samples a rate or median needs.
MinSamples int
}
Options bounds a computation.
type Result ¶
type Result struct {
Deployments int `json:"deployments"`
Changes int `json:"changes"`
FailedChanges int `json:"failed_changes"`
Rollbacks int `json:"rollbacks"`
OpenFailures int `json:"open_failures"`
// DeployFrequency is successful changes per day.
DeployFrequency Metric `json:"deploy_frequency_per_day"`
// LeadTime is the median seconds from commit time to a successful deploy.
LeadTime Metric `json:"lead_time_seconds"`
// ChangeFailureRate is failed changes divided by changes, 0 to 1.
ChangeFailureRate Metric `json:"change_failure_rate"`
// TimeToRestore is the median seconds from a failed change to the next successful deploy.
TimeToRestore Metric `json:"time_to_restore_seconds"`
}
Result holds the four delivery metrics for a set of attempts.