Skip to content

Add utility routines to print 'size' bytes value in human-readable string with unit-specifiers. #511

Description

@gapisback

In various places, we store 'size' in units of bytes, which tend to be printed as big numbers, or rounded-off to print in MiB, GiB etc.

This issue is logged to add facilities to print such values in a user-output buffers with unit-specifiers. The print method should take care of using the appropriate unit-specifiers.

Examples: Print 1024 as 1 KiB, Print 2048 as 2 MiB and so on.
Print, e.g, 1280 bytes as 1.25 KiB. Rather than printing big values, instead print something like 1.75 GiB.

This convenience function was developed in a prototype dev-project and found to be useful for debugging and diagnostics.
Productize and integrate this to /main.

Activity

  1. self-assigned this
    on Dec 23, 2022
  2. added a commit that references this issue on Dec 23, 2022
  3. added 2 commits that reference this issue on Dec 25, 2022
  4. added 7 commits that reference this issue on Jan 6, 2023
  5. added 2 commits that reference this issue on Jan 13, 2023
  6. added a commit that references this issue on Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions