Skip to content
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

fix: node pie graphs to use consistent powers in divisor #4726

Merged
merged 1 commit into from Jan 7, 2020

Conversation

laurelnaiad
Copy link
Contributor

@laurelnaiad laurelnaiad commented Jan 6, 2020

  1. The code determining whether or not the units of requests, limits and
    capacity required normalization was leaving out capacity in its
    determination. As such, if the capacity was of different units than
    requests and limits, they'd be left inconsistent and the percentage
    would be off by at least a factor of 1000 or 1024.
  2. The code normalizing units was erroneously reversing a value in one
    conditional, and thus erroneously triggering a second conditional which
    was reversing the work of the first one (multiplying by the same factor
    by which it had just divided). Rather than fix the bug, it's easier and
    better to just eliminate this code. The conditionals aren't even necessary,
    because negative exponentiation "just works".

@k8s-ci-robot k8s-ci-robot added do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 6, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @laurelnaiad!

It looks like this is your first PR to kubernetes/dashboard 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/dashboard has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 6, 2020
1. The code determining whether or not the units of requests, limits and
capacity  required normalization was leaving out capacity in its
determination. As such, if the capacity was of different units than
requests and limits, they'd be left  inconsistent and the percentage
would be off by at least a factor of 1000 or 1024.

2. The code normalizing units was erroneously reversing a value in one
conditional, and thus erroneously triggering a second conditional which
was reversing the work of the first one (multiplying by the same factor
by which it had just divided). Rather than fix the bug, it's easier and
better to just eliminate this code. The conditionals aren't even necessary,
because negative exponentiation "just works".
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Jan 6, 2020
@laurelnaiad
Copy link
Contributor Author

This is a fix for #4725 . I marked it as "Closes #...", but the robot didn't like that. :)

@codecov
Copy link

codecov bot commented Jan 6, 2020

Codecov Report

Merging #4726 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4726      +/-   ##
==========================================
+ Coverage   45.39%   45.44%   +0.04%     
==========================================
  Files         214      214              
  Lines        9976     9971       -5     
  Branches       96       94       -2     
==========================================
+ Hits         4529     4531       +2     
+ Misses       5181     5176       -5     
+ Partials      266      264       -2
Impacted Files Coverage Δ
src/app/frontend/common/components/graph/helper.ts 75% <100%> (+14.02%) ⬆️

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 ac31fc5...99b5e7b. Read the comment docs.

@floreks
Copy link
Member

floreks commented Jan 7, 2020

Closes #4725

Thanks!

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 7, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: floreks, laurelnaiad

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 7, 2020
@k8s-ci-robot k8s-ci-robot merged commit acb9f1f into kubernetes:master Jan 7, 2020
@laurelnaiad laurelnaiad deleted the units branch January 9, 2020 01:26
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", 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.

None yet

3 participants