PT-2037 - reviewer suggestions

Refactoring pt-stalk to make it easier to call system and MySQL data collections separately
This commit is contained in:
svetasmirnova
2022-01-21 04:12:43 +03:00
parent d6e899404e
commit 1f6c95f524
2 changed files with 113 additions and 65 deletions

View File

@@ -570,7 +570,7 @@ $output = `ls $dest`;
like(
$output,
qr/(df)|(ps)/,
qr/(df)|(meminfo)/,
"Option --system-only collects system data"
);
@@ -580,6 +580,30 @@ unlike(
"Option --system-only does not collect MySQL data"
);
# ###########################################################################
# Test if option --mysql-only works correctly
# ###########################################################################
cleanup();
$retval = system("$trunk/bin/pt-stalk --no-stalk --mysql-only --run-time 10 --sleep 2 --dest $dest --pid $pid_file --iterations 1 -- --defaults-file=$cnf >$log_file 2>&1");
PerconaTest::wait_until(sub { !-f $pid_file });
$output = `ls $dest`;
unlike(
$output,
qr/(df)|(meminfo)/,
"Option --mysql-only does not collect system data"
);
like(
$output,
qr/(innodbstatus)|(mysqladmin)/,
"Option --mysql-only collects MySQL data"
);
# ###########################################################################
# Test report about performance schema transactions in MySQL 5.7+
# ###########################################################################