Skip to content

Fix Diagnose Formatting In Disk Usage Checks#12229

Merged
HridoyRoy merged 8 commits intomainfrom
diagnose-print-fix
Aug 2, 2021
Merged

Fix Diagnose Formatting In Disk Usage Checks#12229
HridoyRoy merged 8 commits intomainfrom
diagnose-print-fix

Conversation

@HridoyRoy
Copy link
Contributor

No description provided.

if usage.UsedPercent > 95 {
SpotWarn(ctx, testName, fmt.Sprintf(partition.Mountpoint+" is %d percent full.", usage.UsedPercent),
Advice("It is recommended to have more than five percent of the partition free."))
SpotWarn(ctx, testName, fmt.Sprintf(partition.Mountpoint+" is %f percent full.", usage.UsedPercent))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually like to limit the number of digits of precision for float printfs, e.g. %.2f. Otherwise it can look ungainly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, didn't realize there was a simple way to make that nicer. Thanks, will do!

} else if usage.Free < 2<<30 {
SpotWarn(ctx, testName, partition.Mountpoint+" has %d bytes full.",
Advice("It is recommended to have at least 1 GB of space free per partition."))
SpotWarn(ctx, testName, fmt.Sprintf(partition.Mountpoint+" has %d bytes free.", usage.Free))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bytes can be hard to read when we're talking about 8-9 digits. Maybe show as MBs or MiBs instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do!

@vercel vercel bot temporarily deployed to Preview – vault August 2, 2021 15:24 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook August 2, 2021 15:24 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook August 2, 2021 15:28 Inactive
@vercel vercel bot temporarily deployed to Preview – vault August 2, 2021 15:28 Inactive
@vercel vercel bot temporarily deployed to Preview – vault August 2, 2021 15:44 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook August 2, 2021 15:44 Inactive
@HridoyRoy HridoyRoy linked an issue Aug 2, 2021 that may be closed by this pull request
@HridoyRoy HridoyRoy requested a review from ncabatoff August 2, 2021 16:05
@vercel vercel bot temporarily deployed to Preview – vault August 2, 2021 16:31 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook August 2, 2021 16:31 Inactive
@HridoyRoy HridoyRoy merged commit 6c234cc into main Aug 2, 2021
@HridoyRoy HridoyRoy deleted the diagnose-print-fix branch August 2, 2021 17:06
tsaarni pushed a commit to Nordix/vault that referenced this pull request Mar 5, 2026
…hicorp#12212) (hashicorp#12229) (hashicorp#12230)

* PKI: Invalidate CMPv2 cached configuration of perf standby nodes

* add cl

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vault Operator Diagnose improperly formats Disk Usage output

2 participants