mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 13:40:07 +00:00
Fixed the Table Cache bugs.
Also makes t/lib/bash/collect_system_info.sh actually call setup_commands.
This commit is contained in:
@@ -1959,7 +1959,7 @@ report_mysql_summary () {
|
||||
|
||||
section Table_cache
|
||||
local open_tables=$(get_var Open_tables "$dir/mysql-status")
|
||||
local table_cache=$(get_table_cache "$dir/mysql-status")
|
||||
local table_cache=$(get_table_cache "$dir/mysql-variables")
|
||||
name_val Size $table_cache
|
||||
name_val Usage "$(fuzzy_pct ${open_tables} ${table_cache})"
|
||||
|
||||
@@ -2014,7 +2014,7 @@ report_mysql_summary () {
|
||||
local dbtodump=""
|
||||
read dbtodump
|
||||
local trg_arg="$( get_mysqldump_args "$dir/mysql-variables" )"
|
||||
get_mysqldump_for "$dir/mysqldump" "${trg_arg}" "${dbtodump}"
|
||||
get_mysqldump_for "${trg_arg}" "${dbtodump}" > "$dir/mysqldump"
|
||||
fi
|
||||
|
||||
if [ -e "$dir/mysqldump" -a -s "$dir/mysqldump" ] \
|
||||
|
@@ -1123,7 +1123,7 @@ report_mysql_summary () {
|
||||
# ########################################################################
|
||||
section Table_cache
|
||||
local open_tables=$(get_var Open_tables "$dir/mysql-status")
|
||||
local table_cache=$(get_table_cache "$dir/mysql-status")
|
||||
local table_cache=$(get_table_cache "$dir/mysql-variables")
|
||||
name_val Size $table_cache
|
||||
name_val Usage "$(fuzzy_pct ${open_tables} ${table_cache})"
|
||||
|
||||
@@ -1195,7 +1195,7 @@ report_mysql_summary () {
|
||||
local dbtodump=""
|
||||
read dbtodump
|
||||
local trg_arg="$( get_mysqldump_args "$dir/mysql-variables" )"
|
||||
get_mysqldump_for "$dir/mysqldump" "${trg_arg}" "${dbtodump}"
|
||||
get_mysqldump_for "${trg_arg}" "${dbtodump}" > "$dir/mysqldump"
|
||||
fi
|
||||
|
||||
# Test the result by checking the file, not by the exit status, because we
|
||||
|
@@ -21,6 +21,8 @@ mkdir "$p"
|
||||
|
||||
parse_options "$BIN_DIR/pt-summary" --sleep 1
|
||||
|
||||
setup_commands
|
||||
|
||||
collect_system_data "$p"
|
||||
|
||||
cat <<EOF > "$TMPDIR/expected"
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
plan 17
|
||||
plan 19
|
||||
|
||||
. "$LIB_DIR/report_formatting.sh"
|
||||
|
||||
@@ -90,6 +90,20 @@ is \
|
||||
is $(fuzz 11) "10" "fuzz 11"
|
||||
is $(fuzz 49) "50" "fuzz 49"
|
||||
|
||||
# fuzzy_pct
|
||||
|
||||
is \
|
||||
"$( fuzzy_pct 28 64 )" \
|
||||
"45%" \
|
||||
"fuzzy_pct of 64 and 28 is 45"
|
||||
|
||||
|
||||
is \
|
||||
"$( fuzzy_pct 40 400 )" \
|
||||
"10%" \
|
||||
"fuzzy_pct of 40 and 400 is 10"
|
||||
|
||||
|
||||
# ###########################################################################
|
||||
# Done
|
||||
# ###########################################################################
|
||||
|
@@ -26,4 +26,3 @@ is \
|
||||
"$(get_var "test::1" "$p")" \
|
||||
"abcdef" \
|
||||
"get_var works if the 'key' has colons"
|
||||
|
||||
|
@@ -111,8 +111,8 @@ Sort_scan 45
|
||||
Table_locks_immediate 80
|
||||
Uptime 90000 1 1
|
||||
# Table cache ################################################
|
||||
Size | 0
|
||||
Usage | 0%
|
||||
Size | 400
|
||||
Usage | 10%
|
||||
# Key Percona Server features ################################
|
||||
Table & Index Stats | Not Supported
|
||||
Multiple I/O Threads | Enabled
|
||||
|
@@ -87,8 +87,8 @@ Table_locks_immediate 1500
|
||||
Threads_created 1750 1
|
||||
Uptime 90000 1 1
|
||||
# Table cache ################################################
|
||||
Size | 0
|
||||
Usage | 0%
|
||||
Size | 64
|
||||
Usage | 35%
|
||||
# Key Percona Server features ################################
|
||||
Table & Index Stats | Not Supported
|
||||
Multiple I/O Threads | Not Supported
|
||||
|
@@ -86,8 +86,8 @@ Table_locks_immediate 3500
|
||||
Threads_created 4000 1
|
||||
Uptime 90000 1 1
|
||||
# Table cache ################################################
|
||||
Size | 0
|
||||
Usage | 0%
|
||||
Size | 64
|
||||
Usage | 60%
|
||||
# Key Percona Server features ################################
|
||||
Table & Index Stats | Not Supported
|
||||
Multiple I/O Threads | Not Supported
|
||||
|
@@ -95,8 +95,8 @@ Table_locks_immediate 12500 3
|
||||
Threads_created 500
|
||||
Uptime 90000 1 1
|
||||
# Table cache ################################################
|
||||
Size | 0
|
||||
Usage | 0%
|
||||
Size | 64
|
||||
Usage | 35%
|
||||
# Key Percona Server features ################################
|
||||
Table & Index Stats | Not Supported
|
||||
Multiple I/O Threads | Not Supported
|
||||
|
Reference in New Issue
Block a user