Skip to content
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

Update pt-mysql-summary #839

Merged
merged 8 commits into from
Jul 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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