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

std.Progress: add byte unit flag and resource scope; support throughput calculation #20103

Open
Tracked by #20059
andrewrk opened this issue May 29, 2024 · 2 comments
Open
Tracked by #20059
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library.
Milestone

Comments

@andrewrk
Copy link
Member

Extracted from #20059.

The idea here is that you would be able to set a flag on a Node that indicates the units are byte. This would make it display, for example,

[6.5 MiB / 10 MiB] Downloading (192 KB/s)

rather than

[6815744/10485760] Downloading

for such a node.

It would also be nice if there was a resource scope. This way the root node could aggregate throughput based on scope and then display something like:

root name (down: 150 KB/s, up: 50 KB/s, disk: 100 MiB/s)
@andrewrk andrewrk added enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library. labels May 29, 2024
@andrewrk andrewrk added this to the 0.16.0 milestone May 29, 2024
@andrewrk andrewrk mentioned this issue May 29, 2024
4 tasks
@VisenDev
Copy link

VisenDev commented Jun 2, 2024

Perhaps allowing a custom unit name parameter could also accomplish similar goals, rather than mandating that the units are either bytes or unspecified.

Or if specific formatting of different unit types is required (such as the byte units being displayed as megabytes or kilobytes), an enum of several different possible unit types could be used.

@jcollie
Copy link
Contributor

jcollie commented Jun 7, 2024

It would be nice if you could specify using 1024-based or 1000-based multipliers (MiB vs MB).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library.
Projects
None yet
Development

No branches or pull requests

3 participants