Do not show thread pool metrics when disabled #577
Merged
+10
−6
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.
Currently thread pool metrics are shown whenever the "thread_pool_size" variable is set. At least on MariaDB this variable is however set even when the thread pool is disabled. This commit changes the check for whether a thread pool is used for client connection handling or not by comparing the "thread_handling" variable value against "pool-of-threads" (MariaDB) or "loaded-dynamically" (MySQL):
The check for whether to show the thread cache metrics is now based on the same derived internal "have_threadpool" variable, effectively skipping thread cache metrics as well on MySQL when the thread pool is not enabled with "thread_handling = loaded-dynamically". The code comment link to Percona about whether the thread cache is used with thread pool enabled has been pinned to v5.7, the latest version which contains the quoted statement. The statement is however still true for MariaDB and MySQL: