Fix mem/file size shortening in pt-summary and pt-mysql-summary.

This commit is contained in:
Daniel Nichter
2012-06-03 14:49:35 -07:00
parent f995a59eb4
commit 696a3b5e68
6 changed files with 19 additions and 33 deletions

View File

@@ -902,7 +902,7 @@ section_innodb () {
local log_file="$(get_var innodb_log_files_in_group "$variables_file")"
local log_total=$(awk "BEGIN {printf \"%.2f\n\", ${log_size}*${log_file}}" )
name_val "Log File Size" \
"${log_file} * $(shorten ${log_size} 1 1000) = $(shorten ${log_total} 1 1000)"
"${log_file} * $(shorten ${log_size} 1) = $(shorten ${log_total} 1)"
name_val "Log Buffer Size" \
"$(shorten $(get_var innodb_log_buffer_size "$variables_file") 0)"
name_val "Flush Method" \

View File

@@ -183,7 +183,7 @@ parse_memory_sysctl_netbsd() { local PTFUNCNAME=parse_memory_sysctl_netbsd;
[ -e "$file" -a -e "$swapctl_file" ] || return
local swap_mem="$(echo "$(awk '{print $2;}' "$swapctl_file")*512" | bc -l)"
local swap_mem="$(awk '{print $2*512}' "$swapctl_file")"
name_val "Total" $(shorten "$(awk '/hw.physmem /{print $NF}' "$file")" 1)
name_val "User" $(shorten "$(awk '/hw.usermem /{print $NF}' "$file")" 1)
name_val "Swap" $(shorten ${swap_mem} 1)
@@ -198,7 +198,7 @@ parse_memory_sysctl_openbsd() { local PTFUNCNAME=parse_memory_sysctl_openbsd;
[ -e "$file" -a -e "$swapctl_file" ] || return
local swap_mem="$(echo "$(awk '{print $2;}' "$swapctl_file")*512" | bc -l)"
local swap_mem="$(awk '{print $2*512}' "$swapctl_file")"
name_val "Total" $(shorten "$(awk -F= '/hw.physmem/{print $2}' "$file")" 1)
name_val "User" $(shorten "$(awk -F= '/hw.usermem/{print $2}' "$file")" 1)
name_val "Swap" $(shorten ${swap_mem} 1)