Skip to content

Commit

Permalink
Fix gettext incorrectly detection string as php-format
Browse files Browse the repository at this point in the history
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
  • Loading branch information
MauricioFauth committed Aug 31, 2020
1 parent 9511919 commit 9cd74ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 9 additions & 3 deletions libraries/advisory_rules_generic.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,12 @@
],
[
'id' => 'Max % MyISAM key buffer ever used',
/* xgettext:no-php-format */
'name' => __('Max % MyISAM key buffer ever used'),
'precondition' => 'key_buffer_size > 0',
'formula' => 'Key_blocks_used * key_cache_block_size / key_buffer_size * 100',
'test' => 'value < 95',
/* xgettext:no-php-format */
'issue' => __('MyISAM key buffer (index cache) % used is low.'),
'recommendation' => __(
'You may need to decrease the size of {key_buffer_size}, re-examine your tables to see'
Expand All @@ -389,6 +391,7 @@
'precondition' => 'key_buffer_size > 0 && !fired(\'Max % MyISAM key buffer ever used\')',
'formula' => '( 1 - Key_blocks_unused * key_cache_block_size / key_buffer_size) * 100',
'test' => 'value < 95',
/* xgettext:no-php-format */
'issue' => __('MyISAM key buffer (index cache) % used is low.'),
'recommendation' => __(
'You may need to decrease the size of {key_buffer_size}, re-examine your tables to see'
Expand All @@ -404,6 +407,7 @@
'precondition' => 'Key_read_requests > 0',
'formula' => '100 - (Key_reads / Key_read_requests * 100)',
'test' => 'value < 95',
/* xgettext:no-php-format */
'issue' => __('The % of indexes that use the MyISAM key buffer is low.'),
'recommendation' => __('You may need to increase {key_buffer_size}.'),
'justification' => __('Index reads from memory: %s%%, this value should be above 95%%'),
Expand Down Expand Up @@ -454,6 +458,7 @@
],
[
'id' => 'Immediate table locks %',
/* xgettext:no-php-format */
'name' => __('Immediate table locks %'),
'precondition' => 'Table_locks_waited + Table_locks_immediate > 0',
'formula' => 'Table_locks_immediate / (Table_locks_waited + Table_locks_immediate) * 100',
Expand Down Expand Up @@ -484,6 +489,7 @@
],
[
'id' => 'Thread cache hit rate %',
/* xgettext:no-php-format */
'name' => __('Thread cache hit rate %'),
'precondition' => 'thread_cache_size > 0',
'formula' => '100 - Threads_created / Connections',
Expand Down Expand Up @@ -612,7 +618,7 @@
'issue' => __(
'The InnoDB log file size is not an appropriate size, in relation to the InnoDB buffer pool.'
),
'recommendation' => __(
'recommendation' => __(/* xgettext:no-php-format */
'Especially on a system with a lot of writes to InnoDB tables you should set'
. ' {innodb_log_file_size} to 25% of {innodb_buffer_pool_size}. However the bigger this value,'
. ' the longer the recovery time will be when database crashes, so this value should not be set'
Expand All @@ -636,7 +642,7 @@
'formula' => 'innodb_log_file_size / (1024 * 1024)',
'test' => 'value > 256',
'issue' => __('The InnoDB log file size is inadequately large.'),
'recommendation' => __(
'recommendation' => __(/* xgettext:no-php-format */
'It is usually sufficient to set {innodb_log_file_size} to 25% of the size of'
. ' {innodb_buffer_pool_size}. A very big {innodb_log_file_size} slows down the recovery'
. ' time after a database crash considerably. See also '
Expand All @@ -657,7 +663,7 @@
'formula' => 'innodb_buffer_pool_size / system_memory * 100',
'test' => 'value < 60',
'issue' => __('Your InnoDB buffer pool is fairly small.'),
'recommendation' => __(
'recommendation' => __(/* xgettext:no-php-format */
'The InnoDB buffer pool has a profound impact on performance for InnoDB tables.'
. ' Assign all your remaining memory to this buffer. For database servers that use solely InnoDB'
. ' as storage engine and have no other services (e.g. a web server) running, you may set this'
Expand Down
2 changes: 2 additions & 0 deletions libraries/advisory_rules_mysql_before80003.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
],
[
'id' => 'Query cache efficiency (%)',
/* xgettext:no-php-format */
'name' => __('Query cache efficiency (%)'),
'precondition' => 'Com_select + Qcache_hits > 0 && !fired(\'Query cache disabled\')',
'formula' => 'Qcache_hits / (Com_select + Qcache_hits) * 100',
Expand All @@ -34,6 +35,7 @@
'precondition' => '!fired(\'Query cache disabled\')',
'formula' => '100 - Qcache_free_memory / query_cache_size * 100',
'test' => 'value < 80',
/* xgettext:no-php-format */
'issue' => __('Less than 80% of the query cache is being utilized.'),
'recommendation' => __(
'This might be caused by {query_cache_limit} being too low.'
Expand Down

0 comments on commit 9cd74ed

Please sign in to comment.