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

fix(feature): Change database logs to human readable forms #8389

Merged
merged 1 commit into from
Apr 11, 2024
Merged

Conversation

oxarbitrage
Copy link
Contributor

Motivation

In #8336 we added logs for database size when zebra starts or shutdowns.

We want to change the output so they are more readable. Close #8380

PR Author Checklist

Check before marking the PR as ready for review:

  • Will the PR name make sense to users?
  • Does the PR have a priority label?
  • Have you added or updated tests?
  • Is the documentation up to date?

Solution

Added https://crates.io/crates/human_bytes as a dependency and used where needed.

New output:

2024-04-09T22:21:59.459266Z  INFO {zebrad="49fca30" net="Main"}: zebra_state::service::finalized_state::disk_db: Total Database Disk Size: 37.1 GB
2024-04-09T22:21:59.459312Z  INFO {zebrad="49fca30" net="Main"}: zebra_state::service::finalized_state::disk_db: Total Live Data Disk Size: 18.3 GB
2024-04-09T22:21:59.459325Z  INFO {zebrad="49fca30" net="Main"}: zebra_state::service::finalized_state::disk_db: Total Database Memory Size: 49.2 KB

Review

Anyone can review.

Reviewer Checklist

Check before approving the PR:

  • Does the PR scope match the ticket?
  • Are there enough tests to make sure it works? Do the tests cover the PR motivation?
  • Are all the PR blockers dealt with?
    PR blockers can be dealt with in new tickets or PRs.

And check the PR Author checklist is complete.

Follow Up Work

@oxarbitrage oxarbitrage added I-usability Zebra is hard to understand or use P-Low ❄️ labels Apr 9, 2024
@oxarbitrage oxarbitrage self-assigned this Apr 9, 2024
@oxarbitrage oxarbitrage requested a review from a team as a code owner April 9, 2024 22:36
@oxarbitrage oxarbitrage requested review from upbqdn and removed request for a team April 9, 2024 22:36
@github-actions github-actions bot added the C-feature Category: New features label Apr 9, 2024
@mergify mergify bot merged commit 339a42f into main Apr 11, 2024
135 checks passed
@mergify mergify bot deleted the issue8380 branch April 11, 2024 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: New features I-usability Zebra is hard to understand or use P-Low ❄️
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature(metrics): Add database metrics in human readable form
2 participants