Skip to content

Commit

Permalink
Merge pull request #839 from MASTERGOKUL/patch-1
Browse files Browse the repository at this point in the history
Update pt-mysql-summary
  • Loading branch information
svetasmirnova authored Jul 21, 2024
2 parents 36090d0 + 4d762d8 commit 1311903
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
8 changes: 7 additions & 1 deletion bin/pt-mysql-summary
Original file line number Diff line number Diff line change
Expand Up @@ -2095,6 +2095,12 @@ section_innodb () {
local bp_free="$(get_var Innodb_buffer_pool_pages_free "$status_file")"
local bp_dirt="$(get_var Innodb_buffer_pool_pages_dirty "$status_file")"
local bp_fill=$((${bp_pags} - ${bp_free}))

local transaction_isolation_var="transaction_isolation"
if [ "$version" '<' "5.7.20" ]; then # false if version >= 5.7.20
transaction_isolation_var="tx_isolation"
fi

name_val "Buffer Pool Fill" "$(fuzzy_pct ${bp_fill} ${bp_pags})"
name_val "Buffer Pool Dirty" "$(fuzzy_pct ${bp_dirt} ${bp_pags})"

Expand Down Expand Up @@ -2129,7 +2135,7 @@ section_innodb () {
name_val "Commit Concurrency" \
"$(get_var innodb_commit_concurrency "$variables_file")"
name_val "Txn Isolation Level" \
"$(get_var tx_isolation "$variables_file")"
"$(get_var $transaction_isolation_var "$variables_file")"
name_val "Adaptive Flushing" \
"$(get_var innodb_adaptive_flushing "$variables_file")"
name_val "Adaptive Checkpoint" \
Expand Down
9 changes: 8 additions & 1 deletion lib/bash/report_mysql_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,13 @@ section_innodb () {
local bp_free="$(get_var Innodb_buffer_pool_pages_free "$status_file")"
local bp_dirt="$(get_var Innodb_buffer_pool_pages_dirty "$status_file")"
local bp_fill=$((${bp_pags} - ${bp_free}))

# dynamically allocate variable name - transaction_isolation
local transaction_isolation_var="transaction_isolation"
if [ "$version" '<' "5.7.20" ]; then # false if version >= 5.7.20
transaction_isolation_var="tx_isolation"
fi

name_val "Buffer Pool Fill" "$(fuzzy_pct ${bp_fill} ${bp_pags})"
name_val "Buffer Pool Dirty" "$(fuzzy_pct ${bp_dirt} ${bp_pags})"

Expand Down Expand Up @@ -1048,7 +1055,7 @@ section_innodb () {
name_val "Commit Concurrency" \
"$(get_var innodb_commit_concurrency "$variables_file")"
name_val "Txn Isolation Level" \
"$(get_var tx_isolation "$variables_file")"
"$(get_var $transaction_isolation_var "$variables_file")"
name_val "Adaptive Flushing" \
"$(get_var innodb_adaptive_flushing "$variables_file")"
name_val "Adaptive Checkpoint" \
Expand Down
2 changes: 1 addition & 1 deletion t/pt-mysql-summary/samples/expected_output_temp_enc008.txt
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ Specify --databases or --all-databases to dump and summarize schemas
Thread Concurrency | 0
Concurrency Tickets | 5000
Commit Concurrency | 0
Txn Isolation Level |
Txn Isolation Level | REPEATABLE-READ
Adaptive Flushing | ON
Adaptive Checkpoint |
Checkpoint Age | 69k
Expand Down
2 changes: 1 addition & 1 deletion t/pt-mysql-summary/samples/expected_output_temp_enc009.txt
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ Specify --databases or --all-databases to dump and summarize schemas
Thread Concurrency | 0
Concurrency Tickets | 5000
Commit Concurrency | 0
Txn Isolation Level |
Txn Isolation Level | REPEATABLE-READ
Adaptive Flushing | ON
Adaptive Checkpoint |
Checkpoint Age | 0
Expand Down

0 comments on commit 1311903

Please sign in to comment.