提交 d5b33397 编写于 作者: C Chris Hajas

Remove run_operator_tests.pl

This is not used by any other utilities and isn't documented anywhere.
Authored-by: NChris Hajas <chajas@pivotal.io>
上级 5e19abb0
......@@ -802,7 +802,6 @@ PVK_SCRIPTS = \
bin/gpscp \
bin/gpssh \
bin/gpcheckperf \
bin/run_operator_tests.pl \
$(NULL)
PVK_FILESET = \
......
......@@ -6,6 +6,5 @@ bin/gptorment.pl
bin/lib/gptest.py
bin/pgbench
bin/postgresql_conf_gp_additions
bin/run_operator_tests.pl
bin/test_fsync
lib/python/gppylib/programs/clsInjectFault.py
......@@ -3,5 +3,4 @@ bin/explain.pm
bin/gpfaultinjector
bin/gptorment.pl
bin/pgbench
bin/run_operator_tests.pl
lib/python/gppylib/programs/clsInjectFault.py
......@@ -27,10 +27,6 @@ Where Things Go
* If you are adding a GP module, please add it to the gppylib dir.
* If you are adding a 3rd party module, please add it to the ext dir.
List of Management Scripts Written in Perl
------------------------------------------
bin/run_operator_tests.pl -
List of Management Scripts Written in Bash
------------------------------------------
bin/gpinitsystem - Creates a new Greenplum Database
......
#!/usr/bin/env perl
####################################################
#Author : Bharath
#Usage : sample usage > perl run_operator_tests.pl -port <Master port number> -dbname <Name of the database with tpch data> -outfile <file where the output of queries is written> -runtime <File into which the query runtimes will be written>
#Notes : The program consolidates all the sql files present in 'opperf' directory into a single flat file, executest the queries and later on extracts the timing information for each of the queries
###################################################
#use strict;
use warnings;
use Getopt::Long;
# Arguments to the program
my ($port, $dbname, $outfile, $runtimes);
GetOptions(
'port=i' => \$port,
'dbname=s' => \$dbname,
'outfile=s' => \$outfile,
'runtime=s' => \$runtime
);
unless (defined($port) && defined($dbname) && defined($outfile) && defined($runtime))
{
print "\nUsage: $0 -port <master port number> -dbname <Name of the database with tpch data> -outfile <File where the output of queries is written> -runtime <File into which the query runtimes will be written>\n\n";
print "Notes: The program consolidates all the sql files present in 'opperf' directory into a single flat file, executes the queries and later on extracts the timing information for each of the queries and writes it to 'runtime file'\n\n".
exit;
}
my $sqlfile = "/tmp/operator_perf_tests_".`date "+%Y%m%d"`;
chomp($sqlfile);
#Gather all the sqls in individual sql files in opperf directory into a temporary file
open(OUT,">$sqlfile") or die("Unable to create file: $sqlfile\n");
print OUT "\\timing\n";
close(OUT);
system("cat opperf/*.sql >> $sqlfile");
print "\nExecuting the queries in $sqlfile \n\n";
print "The output can be viewed in file: $outfile\n";
system("psql -p $port $dbname -a -f $sqlfile > $outfile 2>&1");
print "\nDone with executing the queries......\n\n";
print "Extracting the run times of the queries:";
open(IN,"<$outfile") or die("Unable to open file $outfile\n");
open(OUT,">$runtime") or die("Unable to open file $runtime for writing");
my $query_number=1;
my $guc_setting=0; #variable used to indicate if the previous statement was a GUC setting
while($line=<IN>)
{
chomp($line);
if($line=~/^Time:\s+(\d+\.\d+)\s+ms$/) #Line with timing information
{
if(not $guc_setting) #We don't care about the timings returned for GUC stmts
{
print OUT "Query-$query_number: $1 ms\n";
$query_number++;
}
next;
}
if($line=~/^SET$/)
{
$guc_setting = 1;
}
else
{
$guc_setting = 0;
}
}
print " Done.\n\nThe timing information is available in file: $runtime\n";
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册