Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectMetrics ¶
func CollectMetrics(ctx context.Context, provider metrics.Provider, offset time.Duration, healthCriteria []config.HealthCriterion) ([]float64, error)
CollectMetrics gets a metrics value for each of the given health criteria and returns a result for each criterion.
func StringReport ¶
func StringReport(healthCriteria []config.HealthCriterion, diagnosis Diagnosis, enoughTimeSinceLastRollout bool) string
StringReport returns a human-readable report of the diagnosis.
Types ¶
type CheckResult ¶
CheckResult is information about a metrics criteria check.
type Diagnosis ¶
type Diagnosis struct { OverallResult DiagnosisResult CheckResults []CheckResult }
Diagnosis is the information about the health of the revision.
func Diagnose ¶
func Diagnose(ctx context.Context, healthCriteria []config.HealthCriterion, actualValues []float64) (Diagnosis, error)
Diagnose attempts to determine the health of a revision.
If no health criteria is specified or the size of the health criteria and the actual values are not the same, the diagnosis is Unknown and an error is returned.
Otherwise, all metrics criteria are checked to determine the diagnosis: healthy, unhealthy, or inconclusive.
If the minimum number of requests is not met, the diagnosis is Inconclusive even though all other criteria are met.
However, if any criteria other than the request count is not met, the diagnosis is unhealthy independent on the request count criteria. That is, Unhealthy has precedence over Inconclusive.
type DiagnosisResult ¶
type DiagnosisResult int
DiagnosisResult is a possible result after a diagnosis.
const ( Unknown DiagnosisResult = iota Inconclusive Healthy Unhealthy )
Possible diagnosis results.
func (DiagnosisResult) String ¶
func (d DiagnosisResult) String() string