这是indexloc提供的服务,不要输入任何密码
Skip to content

Add the annotation for averaging algorithm selection. #10840

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

Merged
merged 2 commits into from
Feb 24, 2021

Conversation

vagababov
Copy link
Contributor

I've tried to document the differences. Obviously this will have to go
to the public documentation as well.

I'll provide the rest of the management in a separate PR, once we've
done bikeshedding the name and the comment.

/assign @julz @markusthoemmes

p.s. Markus is out, so it's more like for post-review review 😁

I've tried to document the differences. Obviously this will have to go
to the public documentation as well.

I'll provide the rest of the management in a separate PR, once we've
done bikeshedding the name and the comment.

Change-Id: Iaa66d4968cc3a38ceb16e63bb2d238c80ad9831e
@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Feb 23, 2021
@knative-prow-robot knative-prow-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. area/API API objects and controllers area/autoscale labels Feb 23, 2021
@codecov
Copy link

codecov bot commented Feb 23, 2021

Codecov Report

Merging #10840 (88dc5b0) into master (28b910b) will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10840      +/-   ##
==========================================
- Coverage   88.06%   88.04%   -0.03%     
==========================================
  Files         188      188              
  Lines        9036     9036              
==========================================
- Hits         7958     7956       -2     
- Misses        827      828       +1     
- Partials      251      252       +1     
Impacted Files Coverage Δ
pkg/reconciler/revision/reconcile_resources.go 80.95% <0.00%> (-2.39%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 28b910b...52a35d4. Read the comment docs.

Copy link
Member

@julz julz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly looks good so I have lots of nit-picky questions about bike shed colours

// KPA will compute the decay multiplier automatically and it is capped
// at 0.2 from below. This algorithm might not utilize all the values
// in the window, due to their coefficients being infinitesimal.
MetricAggregationAlgorithm = GroupName + "/metricAggregationAlgorithm"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we mark this experimental somehow? Either just in the comment or even in the annotation name/value? I think we want the freedom to muck around with the UX a bit before it's "set" and we wouldn't want anyone insisting on backwards compat before then. If we feel it's actually good-to-go before next release we can always remove the warning. (I guess a counter-argument is this is an annotation anyway but.. I'm not convinced people treat annotations as hints that might go away in this project)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can leave this as a comment.

// metric window (default);
// - weightedExponential — weighted average with exponential decay.
// KPA will compute the decay multiplier automatically and it is capped
// at 0.2 from below. This algorithm might not utilize all the values
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The word "below" confused me for a bit here. I was initially reading it as referring to an algorithm lower down in the file, but I think we mean 0.2 is the lower bound of the multiplier? Maybe we could use some other form of words if so, like "with a lower bound of 0.2" or just "at least 0.2"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

// - empty/missing or "linear" — linear average over the whole
// metric window (default);
// - weightedExponential — weighted average with exponential decay.
// KPA will compute the decay multiplier automatically and it is capped
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to expand "automatically" somehow, is there a good way to explain the criteria it uses to calculate the multiplier in half a sentence? :). "Automatically based on the size of the window" or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@@ -83,6 +83,19 @@ const (
// scale-to-zero-pod-retention-period global setting.
ScaleToZeroPodRetentionPeriodKey = GroupName + "/scaleToZeroPodRetentionPeriod"

// MetricAggregationAlgorithm is the annotation that can be used for selection
// of the algorithm to use for averaging metric data in the Autoscaler.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we going to apply the same algorithm to both windows or just one? If both, will it always be the same algorithm for both or would there be a use case for a diff algorithm per window? (Obviously asking because we may want to name this StableWindowAggregationAlgorithm, for example, if so).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean panic and stable? I thought to both for uniformity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interestingly, it is probably less important for the panic window, since they are shorter and difference between regular and weighted avg is small.

Change-Id: I24aba2e965bb246a752739b88341818d767a887a
@vagababov
Copy link
Contributor Author

Pushed a new version.

Copy link
Member

@julz julz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 24, 2021
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: julz

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 24, 2021
@knative-prow-robot knative-prow-robot merged commit ee588f5 into knative:master Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/API API objects and controllers area/autoscale cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants