-
Notifications
You must be signed in to change notification settings - Fork 390
fix: [M3-9805] - Revert Object Storage Size Conversions from Base10 to Base2 #12075
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
Conversation
| } | ||
|
|
||
| export type StorageSymbol = 'GB' | 'KB' | 'MB' | 'TB' | 'byte' | 'bytes'; | ||
| export type StorageSymbol = 'byte' | 'bytes' | 'GB' | 'KB' | 'MB' | 'TB'; |
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.
Couple questions here:
- are we not receiving/displaying actual base2 metric names (
GiB,KiB, etc). I believe this was an important consideration - could those types be moved to APIv4 package?
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.
- That is correct - That's an intentional decision from Product which appears to be in alignment with other industry practices
- Potentially! Let me look
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.
I'm not sure it belongs in APIv4 - open to be convinced
On a side note, I think I'm going to follow-up on this PR and try to combine some redundancy from the Cloud Pulse utils packages/manager/src/features/CloudPulse/Utils/unitConversion.ts
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.
fair enough, i suppose API usually sends everything in bytes so yeah, maybe not. It feels more right to import this type from there (which I need to do) but not a big deal.
mjac0bs
left a comment
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.
Looked right based on my understanding of this. Verified...
Object size:
- Displays as 1KB for 1024 byte files
- Displays as 1MB for 1,048,576 byte files
- Displays as 1000 bytes for 1000 byte files
- Displays as 977KB (rounded) for 1,000,000 byte files
| Prod | This Branch |
|---|---|
![]() |
![]() |
Files of various sizes created with truncate command:

Bucket size:
- Sums the sizes of objects in the buckets correctly
- e.g. bucket with two 1000 byte objects displays total size in 1.95KB
Cloud Manager UI test results🎉 565 passing tests on test run #4 ↗︎
|
pmakode-akamai
left a comment
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.
abailly-akamai
left a comment
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.
Confirmed conversion works as expected and and confirmed the GB VS GiB (base2/base10) conversion is accurate and the nomenclature is expected (although I still find it weird we're not displaying GiB, TiB etc




Description 📝
We need to revert a previous PR that changed the OBJ conversions from base2 to base10. Object Storage size conversions need to use base2 calculations even though we display base10 units (MB/GB/TB).
Changes 🔄
readableBytesusageTarget release date 🗓️
5/6 or earlier if out-of-cycle release
How to test 🧪
Verification steps
Object Size:
Bucket Size:
Edge Case Testing:
Author Checklists
As an Author, to speed up the review process, I considered 🤔
👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support
As an Author, before moving this PR from Draft to Open, I confirmed ✅