-
Notifications
You must be signed in to change notification settings - Fork 121
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
Show usage per database. #816
base: development
Are you sure you want to change the base?
Conversation
…reported by customer: https://platformsh.zendesk.com/agent/tickets/60817 Fix is a little bigger than I'd like, but I needed to differentiate between the usage vs allocated. And the usage per database. Because else we're comparing apples and oranges.
Sorry.. what's the bug? |
…rning levels needed there.
I removed the colouring on the database table, because we don't want to alarm the customer for no reason. There is nothing wrong with a customer having a single database ;-) |
Do note that this also fixes a UI bug that was introduced in the previous merge to development. |
Still scratching my head over what the UI bug is. Do you mean the per-relationship usage? That is/was misleading, as the disk exists independently of the relationships, so you'd need to see the full usage on the disk regardless of which relationship is used. Breaking down the usage per schema/table as well as showing the full usage is a useful feature. |
The problem is that you used to be able to specify which database you
wanted to see the size for.
We changed the way the size is calculated to be more accurate (file based
in stead of innodb based). And I forgot that you could specify a specific
database.
As a result, each database shows the total size.
I may have gone a little too far in fixing a bug by adding a feature that
changes the UI. But that was because I discovered that comparing the
allocated space to 1 database, is like comparing apples to oranges.
And that last one was indeed a problem in the previous version as well.
Hence: this is a feature, to solve a bug, which was discovered while fixing
another bug. :)
Sorry I made it a little confusing
…On Fri, 12 Jul 2019, 18:11 Patrick Dawkins, ***@***.***> wrote:
Still scratching my head over what the UI bug is. Do you mean the
per-relationship usage? That is/was misleading, as the disk exists
independently of the relationships, so you'd need to see the full usage on
the disk regardless of which relationship is used. Breaking down the usage
per schema/table as well as showing the full usage is a useful feature.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#816>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA26OE3DEWASR4GREAE7TBTP7CUKRANCNFSM4H33XOBA>
.
|
…h-cli into platformsh-development
@pjcdawkins Do you want me to reclassify this as a feature request to merge this? |
src/Command/Db/DbSizeCommand.php
Outdated
|
||
$this->showInaccessibleSchemas($service, $database); | ||
$db_table = $this->getService('table'); | ||
$db_columns = ['db' => 'Database', 'used' => 'Estimated usage', 'percent' => 'Percentage']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having two tables and naming the columns in both is going to be awkward, I believe it will break the --columns
option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. It does produce weird results. I moved that logic under a flag to make it optional.
@@ -377,12 +418,13 @@ private function getMySqlUsage(HostInterface $host, array $database) { | |||
* | |||
* @return string | |||
*/ | |||
private function formatPercentage($percentage, $machineReadable) { | |||
private function formatPercentage($percentage, $machineReadable, $blnUseColour=true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Irrelevant / unnecessary change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$blnUseColour : I use it, because we don't want to show colours when were simply listing the distribution of database usage size.
See: platform db:size -p sudo27zgjpwqa -vvv -e WEBSUPPORT-170-office-renewal --relationship=management -D
updating dev.
…ibution Otherwise it will produce weird results when using --format and --csv
Customer reported a bug in the new version. That caused him to see the same numbers for every database/relation. I had to add a new table to show the database sizes because we can't directly compare that against the allocated size.
On the bright side: this does make it very clear where the storage usage is coming from.