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

[COST-4394] Fixing OCI GB and TB calculations #4974

Merged
merged 2 commits into from
Mar 14, 2024

Conversation

bacciotti
Copy link
Contributor

Jira Ticket

COST-4394

Description

This change will fix the calculations regarding the OCI conversion from bytes to Gigabytes and from Terabytes/millisecond to Gigabytes/Month, considering that we are using the Decimal Standard, and we have stated that we should use the GB unit.

In the former code, power(2, -30) is used, which is equivalent to dividing by 2^30. This is the conversion factor for bytes to Gibibytes (GiB), where 1 GiB = 2^30 bytes.

This change will fix it, replacing by * power(10, -9), which is equivalent to dividing by 10^9. This is the conversion factor for bytes to Gigabytes (GB), where 1 GB = 10^9 bytes.

When it comes to the TB_MS side, according to the Decimal Standard, we have to multiply by 1000 instead of 1024 (which would convert to GiB).

@bacciotti bacciotti added the oci-smoke-tests Run oci specific smoke tests label Mar 14, 2024
@bacciotti bacciotti requested review from a team as code owners March 14, 2024 10:27
Copy link

codecov bot commented Mar 14, 2024

Codecov Report

Merging #4974 (4ac2d6b) into main (336da02) will increase coverage by 0.0%.
The diff coverage is n/a.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #4974   +/-   ##
=====================================
  Coverage   94.0%   94.1%           
=====================================
  Files        375     375           
  Lines      31124   31124           
  Branches    3697    3697           
=====================================
+ Hits       29272   29274    +2     
+ Misses      1181    1178    -3     
- Partials     671     672    +1     

@bacciotti bacciotti enabled auto-merge (squash) March 14, 2024 11:39
@bacciotti
Copy link
Contributor Author

/retest

@bacciotti bacciotti merged commit 482911f into main Mar 14, 2024
11 checks passed
@bacciotti bacciotti deleted the COST4121-fix-oci-calculations branch March 14, 2024 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
oci-smoke-tests Run oci specific smoke tests smokes-required
Projects
None yet
2 participants