From a4f3ba63b5358ea03aef67142d82c44344b7cc8c Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Fri, 31 Mar 2017 17:48:30 -0300 Subject: [PATCH] PT-118 Added diff rows count to the output --- bin/pt-table-checksum | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index 0dd6007d..95367512 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -10372,6 +10372,7 @@ sub main { # Update chunk-size based on rows/s checksum rate. $nibble_iter->set_chunk_size($tbl->{chunk_size}); + PTDEBUG && _d('Updated chunk size: '.$tbl->{chunk_size}); } # Every table should have a Progress obj; update it. @@ -10445,6 +10446,12 @@ sub main { map { $diff_chunks{ $_->{chunk} }++ } @$diffs; $exit_status |= $PTC_EXIT_STATUS{TABLE_DIFF}; } + my $max_cnt_diff=0; + for my $diff (@$diffs) { + if ( $diff->{cnt_diff} > $max_cnt_diff ) { + $tbl->{checksum_results}->{max_rows_cnt_diff} = $diff->{cnt_diff}; + } + } }; if ($EVAL_ERROR) { if ( $o->get('quiet') < 2 ) { @@ -10879,8 +10886,8 @@ sub exec_nibble { } { -my $line_fmt = "%14s %6s %6s %8s %7s %7s %7s %-s\n"; -my @headers = qw(TS ERRORS DIFFS ROWS CHUNKS SKIPPED TIME TABLE); +my $line_fmt = "%14s %6s %6s %8s % 10s %7s %7s %7s %-s\n"; +my @headers = qw(TS ERRORS DIFFS ROWS DIFF_ROWS CHUNKS SKIPPED TIME TABLE); sub print_checksum_results { my (%args) = @_; @@ -10900,7 +10907,8 @@ sub print_checksum_results { ts(), $res->{errors} || 0, $res->{diffs} || 0, - $res->{n_rows} || 0, + $res->{n_rows} || 0, + $tbl->{checksum_results}->{max_rows_cnt_diff} || 0, $res->{n_chunks} || 0, $res->{skipped} || 0, sprintf('%.3f', $res->{start_time} ? time - $res->{start_time} : 0),