pqd: Replaced --print with --output slowlog

This commit is contained in:
Brian Fraser
2013-02-25 12:27:13 -03:00
parent 3c02b4df9c
commit 5e8f369ab7
3 changed files with 7 additions and 7 deletions

View File

@@ -13404,14 +13404,14 @@ sub main {
}
} # sample
if ( $o->get('print') ) {
if ( $o->get('output') =~ /slowlog/i ) {
my $w = new SlowLogWriter();
$pipeline->add(
name => 'print',
name => '--output slowlog',
process => sub {
my ( $args ) = @_;
my $event = $args->{event};
PTDEBUG && _d('callback: print');
PTDEBUG && _d('callback: --output slowlog');
$w->write(*STDOUT, $event);
return $args;
},

View File

@@ -20,13 +20,13 @@ my $run_with = "$trunk/bin/pt-query-digest --report-format=query_report --limit
# pipeline
# #############################################################################
ok(
no_diff($run_with.'slow034.txt --no-report --print', "t/pt-query-digest/samples/slow034-inheritance.txt"),
no_diff($run_with.'slow034.txt --no-report --output slowlog', "t/pt-query-digest/samples/slow034-inheritance.txt"),
'Analysis for slow034 with inheritance'
);
# Make sure we can turn off some default inheritance, 'ts' in this test.
ok(
no_diff($run_with.'slow034.txt --no-report --print --inherit-attributes db', "t/pt-query-digest/samples/slow034-no-ts-inheritance.txt"),
no_diff($run_with.'slow034.txt --no-report --output slowlog --inherit-attributes db', "t/pt-query-digest/samples/slow034-no-ts-inheritance.txt"),
'Analysis for slow034 without default ts inheritance'
);

View File

@@ -18,7 +18,7 @@ use PerconaTest;
# #############################################################################
ok(
no_diff("$trunk/bin/pt-query-digest $trunk/t/lib/samples/slowlogs/slow006.txt "
. '--no-report --print --sample 2',
. '--no-report --output slowlog --sample 2',
"t/pt-query-digest/samples/slow006-first2.txt"),
'Print only first N unique occurrences with explicit --group-by',
);
@@ -28,7 +28,7 @@ ok(
# #############################################################################
ok(
no_diff("$trunk/bin/pt-query-digest $trunk/t/lib/samples/slowlogs/slow006.txt "
. '--no-report --print --sample 2',
. '--no-report --output slowlog --sample 2',
"t/pt-query-digest/samples/slow006-first2.txt"),
'Print only first N unique occurrences, --no-report',
);