-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat(nodeScaleDownTime): add a new metric to track unprocessed nodes during scaleDown #8614
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
base: master
Are you sure you want to change the base?
feat(nodeScaleDownTime): add a new metric to track unprocessed nodes during scaleDown #8614
Conversation
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Welcome @shaikenov! |
Hi @shaikenov. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
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.
very good
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: kada2004, shaikenov The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
b9e7969
to
86a98d1
Compare
86a98d1
to
0457f73
Compare
0457f73
to
c2756ca
Compare
c2756ca
to
a279f58
Compare
e5f5131
to
65b09dd
Compare
timestamp = timestamp.Add(1 * time.Second) | ||
assert.Equal(t, longestScaleDownEvalT.update(tc.unprocessedNodes[0], timestamp), tc.wantLongestScaleDownEvalTime[0]) | ||
if tc.unprocessedNodes[0] == nil { | ||
start = timestamp | ||
} | ||
timestamp = timestamp.Add(1 * time.Second) | ||
assert.Equal(t, longestScaleDownEvalT.update(tc.unprocessedNodes[1], timestamp), tc.wantLongestScaleDownEvalTime[1]) | ||
assert.Equal(t, len(longestScaleDownEvalT.nodeNamesWithTimeStamps), len(tc.unprocessedNodes[1])) | ||
for _, val := range longestScaleDownEvalT.nodeNamesWithTimeStamps { | ||
assert.Equal(t, val, start) | ||
} | ||
timestamp = timestamp.Add(1 * time.Second) | ||
currentLastEvalTime := longestScaleDownEvalT.lastEvalTime | ||
assert.Equal(t, longestScaleDownEvalT.update(tc.unprocessedNodes[2], timestamp), tc.wantLongestScaleDownEvalTime[2]) // longestTime is for node n2 | ||
assert.Equal(t, longestScaleDownEvalT.get("n1"), longestScaleDownEvalT.lastEvalTime) | ||
assert.Equal(t, longestScaleDownEvalT.get("n2"), start) | ||
assert.Equal(t, longestScaleDownEvalT.get("n3"), currentLastEvalTime) // timestamp for new nodes is the default time before update | ||
timestamp = timestamp.Add(1 * time.Second) | ||
assert.Equal(t, longestScaleDownEvalT.update(tc.unprocessedNodes[3], timestamp), tc.wantLongestScaleDownEvalTime[3]) // leftover from the previous iteration is time for node n2 | ||
timestamp = timestamp.Add(1 * time.Second) | ||
assert.Equal(t, longestScaleDownEvalT.update(tc.unprocessedNodes[4], timestamp), tc.wantLongestScaleDownEvalTime[4]) // no leftover, so the longestTime will be 0 |
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.
Nit: I think some of these checks are examining implementation details; removing them would simplify things significantly:
iterations:= len(unprocessedNodes)
for i range iterations {
time += 1 sec
assert.Equal(t, longestScaleDownEvalT.update(tc.unprocessedNodes[i], time), tc.wantLongestScaleDownEvalTime[i])
}
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.
fixed
name string | ||
maxParallel int | ||
isSimulationTimeout bool | ||
wantUnprocessedNodes int |
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.
Nit: Typically want
params are last ones.
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.
yes, did not notice it before
}, []string{"instance_type", "cpu_count", "namespace_count"}, | ||
) | ||
|
||
longestLastScaleDownEvalDuration = k8smetrics.NewGauge( |
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.
Nit: If you look at other metrics names are aligned and here: longestLastScaleDownEvalDuration != longest_unneeded_node_scale_down_eval_duration_seconds
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.
yes, did not notice it before
… nodes during scaleDown
65b09dd
to
716b1c3
Compare
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR adds a new metric to the exported prometheus metrics list: LongestNodeScaleDownTime
We want to track all the nodes that were marked as unneeded, but were unprocessed during the ScaleDown. If a node was unneeded, but unprocessed multiple times consecutively, we store only the earliest time it happened. The difference between the current time and the earliest time among all unprocessed nodes will give the longest time. This time can give us an indication of possible throttling and helps to better monitor what happens during ScaleDown.
Which issue(s) this PR fixes:
None
Special notes for your reviewer: this is a draft PR, work is still in progress
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
None