-
Notifications
You must be signed in to change notification settings - Fork 517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SLO parameter to API availability measurement #1776
Conversation
@@ -252,7 +259,10 @@ func (a *apiAvailabilityMeasurement) gather() ([]measurement.Summary, error) { | |||
} | |||
summary := measurement.CreateSummary(apiAvailabilityMeasurementName, "json", content) | |||
a.summaries = append(a.summaries, summary) | |||
return a.summaries, nil | |||
if sli := output.ClusterSummary.AvailabilityPercentage; sli < a.threshold { | |||
err = fmt.Errorf("API availability SLO not fulfilled (SLI: %.2f, SLO: %.2f)", sli, a.threshold) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NewMetricViolationError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -252,7 +259,10 @@ func (a *apiAvailabilityMeasurement) gather() ([]measurement.Summary, error) { | |||
} | |||
summary := measurement.CreateSummary(apiAvailabilityMeasurementName, "json", content) | |||
a.summaries = append(a.summaries, summary) | |||
return a.summaries, nil | |||
if sli := output.ClusterSummary.AvailabilityPercentage; sli < a.threshold { | |||
err = fmt.Errorf("API availability SLO not fulfilled (SLI: %.2f, SLO: %.2f)", sli, a.threshold) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you make it more readable, without so many acronyms?
like "got: x, expected >= x"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -252,7 +259,10 @@ func (a *apiAvailabilityMeasurement) gather() ([]measurement.Summary, error) { | |||
} | |||
summary := measurement.CreateSummary(apiAvailabilityMeasurementName, "json", content) | |||
a.summaries = append(a.summaries, summary) | |||
return a.summaries, nil | |||
if sli := output.ClusterSummary.AvailabilityPercentage; sli < a.threshold { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you comparing percentage with a fraction?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also: having percentage in the summary and fraction in an error and variable is inconsistent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you comparing percentage with a fraction?
Also: having percentage in the summary and fraction in an error and variable is inconsistent
Nope, this is a comparison of percentages, not fractions. threshold
parameter is also provided as a percentage in the config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right
CL2_API_AVAILABILITY_THRESHOLD 0.0
suggested otherwise
Maybe CL2_API_AVAILABILITY_PERCENTAGE_THRESHOLD
then, to make it more explicit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good! Done.
f46832a
to
a7873eb
Compare
a7873eb
to
60cf1a2
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jkaniuk, tosi3k The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Add a configurable threshold parameter that would serve as an SLO for the measurement.
/sig scalability
/assign @jkaniuk