-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Implement using /metrics/resource Kubelet endpoint #777
Implement using /metrics/resource Kubelet endpoint #777
Conversation
5b33e37
to
bd5008e
Compare
bd5008e
to
155a240
Compare
60a298b
to
c6398d6
Compare
@serathius I have fixed all. Could you take a look? |
087a07a
to
8e26cd2
Compare
@serathius, I have been trying but it doesn't seem to work.Maybe the data content in the file is too different, So the file is recognized as deleted and added instead of moved, Is there a good way to modify? |
for containerName, containerMetric := range podMetric.Containers { | ||
if containerMetric != (storage.MetricsPoint{}) { | ||
//drop metrics when Timestamp is zero | ||
if containerMetric.Timestamp.IsZero() || containerMetric.CumulativeCpuUsed == 0 || containerMetric.MemoryUsage == 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.
Vs previous code, this removes the need for container.StartTime to be provided. Can you check if Storage will handle case with StartTime zero, is there a test for it?
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.
yeah, I updated the test cases.
Overall this looks ok for me. Would also want an LGTM from @dgrisonnet. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: serathius, yangjunmyfm192085 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 |
8e26cd2
to
a14c569
Compare
/cc dgrisonnet |
/assign @dgrisonnet |
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.
Just two comments from my side, but it looks good to me otherwise.
Signed-off-by: JunYang <[email protected]>
a14c569
to
a2d732e
Compare
Hi, @dgrisonnet, thanks for your review, I have applied all your suggestion. Could you take a look again? |
Awesome, thanks @yangjunmyfm192085. /lgtm |
Signed-off-by: JunYang [email protected]
What this PR does / why we need it:
Implement using /metrics/resource Kubelet endpoint
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #559