Fix #3448 quota calculation for monthly tariffs - #5517
Conversation
|
Your code looks alright @jairov4 but only if the aggregation is always hourly. I think there is another problem with the code and that is that the onehour vars are not named correctly; |
|
@DaanHoogland yes, this calculation is independent of the aggregation ratio because the raw usage variable is the number of hours used, then we only need the hour cost to compute the final quota for the aggregation time slot. As you can see in |
|
btw: should I rebase it to 4.15? |
|
You can rebase it @jairov4 , if you want it on that branch. It is unlikely an new 4.15 version will come out. if you do it will be merged forward to 4.16 as well. |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✖️ el8 ✖️ debian ✖️ suse15. SL-JID 1729 |
|
@blueorangutan package |
|
@rohityadavcloud a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2144 |
|
@blueorangutan test |
|
@sureshanaparti a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-2838)
|
DaanHoogland
left a comment
There was a problem hiding this comment.
genrally good to go, but some instances of the parameter aggregationRotio need to be removed.
DaanHoogland
left a comment
There was a problem hiding this comment.
@jairov4 , please remove the parameter aggregationRatio from methods that no longer use it.
|
@sureshanaparti done! |
|
@blueorangutan package |
|
@sureshanaparti a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2461 |
|
@blueorangutan test |
|
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-3164)
|
|
@jairov4 looks good no regressions. The test_quota.py integration test is not run in either the smoke tests or in travis, So I'll run thos manually to make triple sure. |
|
I ran the quota tests and got all to succeed except for one that requires more than a single day of data to accumulate. recarding this as success and merging because of succesfull testing and multiple LTGM. |

Description
The quota calculation has been wrong for monthly tariffs (like Compute-Month, GB-Month, etc) for so much time but even when #3448 was reported it was closed without evaluation.
The wrong calculation was the price per hour, it was taking the monthly tariff and multiplying by the aggregation ratio which has no sense at all.
The right price per hour is the monthly tariff divided by the standard number of hours in a month.
Fixes #3448.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
How Has This Been Tested?
Partial execution of the component with a test vector.
Tracing the values and compared with spreadsheet.