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

[FEATURE]: Print total size of listed keys #2148

Closed
khssnv opened this issue Jan 9, 2025 · 0 comments · Fixed by #2149
Closed

[FEATURE]: Print total size of listed keys #2148

khssnv opened this issue Jan 9, 2025 · 0 comments · Fixed by #2149
Labels
kind/feature Something completely new we should consider.

Comments

@khssnv
Copy link
Contributor

khssnv commented Jan 9, 2025

Have you tried Badger before this proposal? and did not find anything similar?

Yes

What you wanted to do.

Get total size of keys listed by badger info --show-keys --with-prefix ....

What you actually did.

I had to make a script to parse the output and compute the sum from the size of each single item.

Why wasn't it great, with examples.

The sub-command already returns the total number of keys counting listed keys. It also returns the size of each key-value pair listed. The total size seems like a missing part which completes the picture.

Additional information.

After the feature implementation badger info output may look like the following (new line starts with Total Size...).

$ badger info --show-keys --with-prefix 0815 --dir .
Listening for /debug HTTP requests at port: 8080

...

[Summary]
Total Number of keys: 3908
Total Size of key-value pairs: 1290200
Num Allocated Bytes at program end: 0 B
@khssnv khssnv added the kind/feature Something completely new we should consider. label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Something completely new we should consider.
Development

Successfully merging a pull request may close this issue.

1 participant