Set number of hours per month with actual number in Quota - #7210
Conversation
Codecov Report
@@ Coverage Diff @@
## main #7210 +/- ##
============================================
+ Coverage 29.15% 30.99% +1.84%
+ Complexity 30909 30723 -186
============================================
Files 5165 4827 -338
Lines 364111 337386 -26725
Branches 53306 48559 -4747
============================================
- Hits 106153 104582 -1571
+ Misses 243397 218410 -24987
+ Partials 14561 14394 -167
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 523 files with indirect coverage changes 📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
|
SonarCloud Quality Gate failed. |
|
@stephankruggg cc @GaOrtiga can you please check the outstanding review comments? |
|
@stephankruggg can you answer my question #7210 (comment) ? |
b62e20e to
d419dcd
Compare
|
@blueorangutan package |
|
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
ui build error is in codecov push, not in code. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7763 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-8331)
|
Co-authored-by: Stephan Krug <stephan.krug@scclouds.com.br> Co-authored-by: Gabriel <gabriel.fernandes@scclouds.com.br>









Description
The Quota usage value for monthly usage types uses the cost per hour to calculate the total tariff value in a particular period. In order to define the cost per hour, it takes into account the total number of hours in each month. However, this value is currently fixed at 720 hours for every month.
This causes incorrect values when calculating the cost per hour, resulting in costs being higher than expected. Therefore, this PR aims to calculate the number of hours in each month based on the actual number of days of each month.
For example, if the tariff value is 100 per month, the current cost per hour is 0.138888889 for every month. For 1 hour per month the total cost in a year would be 1.666666668.
With the adjustments to the cost per hour of this PR, the costs per hour would be: 0.134408602 (January, March, May, July, August, October, December), 0.148809524 (February of a non-leap year), 0.143678161 (February of a leap year), and 0.138888889 (April, June, September, November). This results in 1.645225294 for a non-leap year and 1.640093931 for a leap year at 1 hour per month, which is a difference of about 1.3% in costs to the current method.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
How Has This Been Tested?
In a local lab I applied the changes, and manually changed the current month of the MS to every month in a year (including February of a leap year) and verified if the cost per hour was calculated correctly using the number of hours of each month when the
quotaUpdateAPI was called.