mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 13:40:07 +00:00
Use hostN intead of full hostname in Compare* summaries.
This commit is contained in:
@@ -254,8 +254,10 @@ sub report {
|
||||
my $query_id_col = {
|
||||
name => 'Query ID',
|
||||
};
|
||||
my $hostno = 0;
|
||||
my @host_cols = map {
|
||||
my $col = { name => $_->{name} };
|
||||
$hostno++;
|
||||
my $col = { name => "host$hostno" };
|
||||
$col;
|
||||
} @$hosts;
|
||||
|
||||
@@ -297,12 +299,14 @@ sub _report_diff_big {
|
||||
|
||||
my $report = new ReportFormatter();
|
||||
$report->set_title('Big query time differences');
|
||||
my $hostno = 0;
|
||||
$report->set_columns(
|
||||
$args{query_id_col},
|
||||
map {
|
||||
my $col = { name => $_->{name}, right_justify => 1 };
|
||||
(map {
|
||||
$hostno++;
|
||||
my $col = { name => "host$hostno", right_justify => 1 };
|
||||
$col;
|
||||
} @{$args{hosts}},
|
||||
} @{$args{hosts}}),
|
||||
{ name => 'Difference', right_justify => 1 },
|
||||
);
|
||||
|
||||
@@ -344,12 +348,14 @@ sub _report_diff_in_bucket {
|
||||
|
||||
my $report = new ReportFormatter();
|
||||
$report->set_title('Significant query time differences');
|
||||
my $hostno = 0;
|
||||
$report->set_columns(
|
||||
$args{query_id_col},
|
||||
map {
|
||||
my $col = { name => $_->{name}, right_justify => 1 };
|
||||
(map {
|
||||
$hostno++;
|
||||
my $col = { name => "host$hostno", right_justify => 1 };
|
||||
$col;
|
||||
} @{$args{hosts}},
|
||||
} @{$args{hosts}}),
|
||||
{ name => '%Increase', right_justify => 1 },
|
||||
{ name => '%Threshold', right_justify => 1 },
|
||||
);
|
||||
|
@@ -836,8 +836,10 @@ sub report {
|
||||
my $query_id_col = {
|
||||
name => 'Query ID',
|
||||
};
|
||||
my $hostno = 0;
|
||||
my @host_cols = map {
|
||||
my $col = { name => $_->{name} };
|
||||
$hostno++;
|
||||
my $col = { name => "host$hostno" };
|
||||
$col;
|
||||
} @$hosts;
|
||||
|
||||
@@ -933,12 +935,14 @@ sub _report_diff_row_counts {
|
||||
|
||||
my $report = new ReportFormatter();
|
||||
$report->set_title('Row count differences');
|
||||
my $hostno = 0;
|
||||
$report->set_columns(
|
||||
$args{query_id_col},
|
||||
map {
|
||||
my $col = { name => $_->{name}, right_justify => 1 };
|
||||
(map {
|
||||
$hostno++;
|
||||
my $col = { name => "host$hostno", right_justify => 1 };
|
||||
$col;
|
||||
} @{$args{hosts}},
|
||||
} @{$args{hosts}}),
|
||||
);
|
||||
|
||||
my $diff_row_counts = $self->{diffs}->{row_counts};
|
||||
|
@@ -292,8 +292,10 @@ sub report {
|
||||
my $query_id_col = {
|
||||
name => 'Query ID',
|
||||
};
|
||||
my $hostno = 0;
|
||||
my @host_cols = map {
|
||||
my $col = { name => $_->{name} };
|
||||
$hostno++;
|
||||
my $col = { name => "host$hostno" };
|
||||
$col;
|
||||
} @$hosts;
|
||||
|
||||
@@ -336,7 +338,7 @@ sub _report_diff_warnings {
|
||||
my ($hostno, $code, $message) = @{$diff_warnings->{$item}->{$_}};
|
||||
$report->add_line(
|
||||
$get_id->($item) . '-' . $_,
|
||||
$args{hosts}->[$hostno]->{name}, $code, $message,
|
||||
"host" . ($hostno + 1), $code, $message,
|
||||
);
|
||||
} sort { $a <=> $b } keys %{$diff_warnings->{$item}};
|
||||
}
|
||||
@@ -357,13 +359,15 @@ sub _report_diff_levels {
|
||||
|
||||
my $report = new ReportFormatter(extend_right => 1);
|
||||
$report->set_title('Warning level differences');
|
||||
my $hostno = 0;
|
||||
$report->set_columns(
|
||||
$args{query_id_col},
|
||||
{ name => 'Code', right_justify => 1 },
|
||||
map {
|
||||
my $col = { name => $_->{name}, right_justify => 1 };
|
||||
(map {
|
||||
$hostno++;
|
||||
my $col = { name => "host$hostno", right_justify => 1 };
|
||||
$col;
|
||||
} @{$args{hosts}},
|
||||
} @{$args{hosts}}),
|
||||
{ name => 'Message' },
|
||||
);
|
||||
|
||||
@@ -393,12 +397,14 @@ sub _report_diff_warning_counts {
|
||||
|
||||
my $report = new ReportFormatter();
|
||||
$report->set_title('Warning count differences');
|
||||
my $hostno = 0;
|
||||
$report->set_columns(
|
||||
$args{query_id_col},
|
||||
map {
|
||||
my $col = { name => $_->{name}, right_justify => 1 };
|
||||
(map {
|
||||
$hostno++;
|
||||
my $col = { name => "host$hostno", right_justify => 1 };
|
||||
$col;
|
||||
} @{$args{hosts}},
|
||||
} @{$args{hosts}}),
|
||||
);
|
||||
|
||||
my $diff_warning_counts = $self->{diffs}->{warning_counts};
|
||||
|
@@ -150,8 +150,8 @@ compare(0.000100, 0.000250);
|
||||
|
||||
$report = <<EOF;
|
||||
# Significant query time differences
|
||||
# Query ID server1 server2 %Increase %Threshold
|
||||
# ================== ======= ======= ========= ==========
|
||||
# Query ID host1 host2 %Increase %Threshold
|
||||
# ================== ===== ===== ========= ==========
|
||||
# EDEF654FCCC4A4D8-0 100us 250us 150.00 100
|
||||
EOF
|
||||
|
||||
@@ -166,8 +166,8 @@ compare(0.000100, 1.100251);
|
||||
|
||||
$report = <<EOF;
|
||||
# Big query time differences
|
||||
# Query ID server1 server2 Difference
|
||||
# ================== ======= ======= ==========
|
||||
# Query ID host1 host2 Difference
|
||||
# ================== ===== ===== ==========
|
||||
# EDEF654FCCC4A4D8-0 100us 1s 1s
|
||||
EOF
|
||||
|
||||
|
@@ -279,13 +279,13 @@ is_deeply(
|
||||
|
||||
$report = <<EOF;
|
||||
# Checksum differences
|
||||
# Query ID master slave
|
||||
# Query ID host1 host2
|
||||
# ================== ========= ==========
|
||||
# D2D386B840D3BEEA-1 $events[0]->{checksum} $events[1]->{checksum}
|
||||
|
||||
# Row count differences
|
||||
# Query ID master slave
|
||||
# ================== ====== =====
|
||||
# Query ID host1 host2
|
||||
# ================== ===== =====
|
||||
# D2D386B840D3BEEA-1 3 4
|
||||
EOF
|
||||
|
||||
@@ -488,13 +488,13 @@ is_deeply(
|
||||
|
||||
$report = <<EOF;
|
||||
# Column value differences
|
||||
# Query ID Column master slave
|
||||
# ================== ====== ====== ===========
|
||||
# Query ID Column host1 host2
|
||||
# ================== ====== ===== ===========
|
||||
# CFC309761E9131C5-3 c c should be c
|
||||
|
||||
# Row count differences
|
||||
# Query ID master slave
|
||||
# ================== ====== =====
|
||||
# Query ID host1 host2
|
||||
# ================== ===== =====
|
||||
# B8B721D77EA1FD78-0 3 4
|
||||
EOF
|
||||
|
||||
@@ -552,8 +552,8 @@ is_deeply(
|
||||
|
||||
$report = <<EOF;
|
||||
# Column value differences
|
||||
# Query ID Column master slave
|
||||
# ================== ====== ====== ===========
|
||||
# Query ID Column host1 host2
|
||||
# ================== ====== ===== ===========
|
||||
# CFC309761E9131C5-3 c a should be a
|
||||
EOF
|
||||
|
||||
@@ -674,8 +674,8 @@ is_deeply(
|
||||
|
||||
$report = <<EOF;
|
||||
# Row count differences
|
||||
# Query ID master slave
|
||||
# ================== ====== =====
|
||||
# Query ID host1 host2
|
||||
# ================== ===== =====
|
||||
# D56E6FABA26D1F1C-3 3 1
|
||||
EOF
|
||||
|
||||
|
@@ -257,7 +257,7 @@ is_deeply(
|
||||
|
||||
$report = <<EOF;
|
||||
# Warning level differences
|
||||
# Query ID Code dbh-1 dbh-2 Message
|
||||
# Query ID Code host1 host2 Message
|
||||
# ================== ==== ======= ===== ======================================
|
||||
# 4336C4AAA4EEF76B-1 1264 Warning Error Out of range value for column 'i' at row 1
|
||||
EOF
|
||||
@@ -291,10 +291,10 @@ $report = <<EOF;
|
||||
# New warnings
|
||||
# Query ID Host Code Message
|
||||
# ================== ===== ==== ==========================================
|
||||
# 4336C4AAA4EEF76B-1 dbh-1 1264 Out of range value for column 'i' at row 1
|
||||
# 4336C4AAA4EEF76B-1 host1 1264 Out of range value for column 'i' at row 1
|
||||
|
||||
# Warning count differences
|
||||
# Query ID dbh-1 dbh-2
|
||||
# Query ID host1 host2
|
||||
# ================== ===== =====
|
||||
# 4336C4AAA4EEF76B-1 1 0
|
||||
EOF
|
||||
@@ -325,10 +325,10 @@ $report = <<EOF;
|
||||
# New warnings
|
||||
# Query ID Host Code Message
|
||||
# ================== ===== ==== ==========================================
|
||||
# 4336C4AAA4EEF76B-1 dbh-2 1264 Out of range value for column 'i' at row 1
|
||||
# 4336C4AAA4EEF76B-1 host2 1264 Out of range value for column 'i' at row 1
|
||||
|
||||
# Warning count differences
|
||||
# Query ID dbh-1 dbh-2
|
||||
# Query ID host1 host2
|
||||
# ================== ===== =====
|
||||
# 4336C4AAA4EEF76B-1 0 1
|
||||
EOF
|
||||
|
Reference in New Issue
Block a user