17686 config option for disk divider #18011
Open
+41
−18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #17686 Ability to select disk divider
I added two new config options to specify the divider used to calculate the disk and ram sizes in different units.
The default value is 1000 but can be changed to 1024 to get GiB instead of GB.
Those config values are used in the
humanize_megabytes
method. I split this method into two separate methods, one for RAM and one for disk values. Additionally I added the disk config value to the disk migration so that users with GiB values get them converted to MiB.I tested the changes in my local environment and noticed no problems.
I'm open for feedback and I also didn't include any tests yet.