Update Compare* modules in pt-upgrade.

This commit is contained in:
Daniel Nichter
2012-07-17 16:51:39 -06:00
parent e797e463c1
commit c78c3bfbab
3 changed files with 41 additions and 25 deletions

View File

@@ -9498,8 +9498,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;
@@ -9595,12 +9597,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};
@@ -9836,8 +9840,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;
@@ -9867,12 +9873,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 },
);
@@ -9902,12 +9910,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 },
);
@@ -10186,8 +10196,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;
@@ -10230,7 +10242,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}};
}
@@ -10251,13 +10263,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' },
);
@@ -10287,12 +10301,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};

View File

@@ -36,9 +36,9 @@ select i from t where i is not null
# Row count differences
# Query ID 127.1:12345 127.1:12348
# ================== =========== ===========
# 3C830E3839B916D7-1 4 3
# Query ID host1 host2
# ================== ===== =====
# 3C830E3839B916D7-1 4 3
# Statistics
# events 1

View File

@@ -36,9 +36,9 @@ SELECT SUM(total) FROM test.t WHERE id > 0
# Column value differences
# Query ID Column 127.1:12345 127.1:12348
# ================== ========== =========== ===========
# C1B1E457814417E4-1 SUM(total) 14.68 13.68
# Query ID Column host1 host2
# ================== ========== ===== =====
# C1B1E457814417E4-1 SUM(total) 14.68 13.68
# Statistics
# events 1