diff options
author | Andrew Lenharth <andrewl@lenharth.org> | 2005-05-20 17:33:42 +0000 |
---|---|---|
committer | Andrew Lenharth <andrewl@lenharth.org> | 2005-05-20 17:33:42 +0000 |
commit | 24d77506d07d3e69f65ce82d1040231797f4a5dc (patch) | |
tree | 635af7b54cc7b226c4386b55ddd2f8ba80d6c99a /utils/cgiplotNLT.pl | |
parent | 170fbcbc635f95b551d71c0e30214bf667d70cc2 (diff) |
OK, the simple scheme for the db plus a couple of cgi scripts that
do the dynamic plotting of stuff. Still being tested, but makes graphs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22152 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/cgiplotNLT.pl')
-rwxr-xr-x | utils/cgiplotNLT.pl | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/utils/cgiplotNLT.pl b/utils/cgiplotNLT.pl new file mode 100755 index 0000000000..d9b61d813f --- /dev/null +++ b/utils/cgiplotNLT.pl @@ -0,0 +1,67 @@ +#!/usr/bin/perl +#takes a test and a program from a dp and produces a gnuplot script +#use like perl plotNLT.pl password Programs/MultiSource/Benchmarks/ASCI_Purple/SMG2000/smg2000 llc + +use CGI; +use DBI; +my $q = new CGI; + +# database information +$db="llvmalpha"; +$host="localhost"; +$userid="llvmdbuser"; +$passwd=$q->param('pwd'); +$connectionInfo="dbi:mysql:$db;$host"; + +# make connection to database +$dbh = DBI->connect($connectionInfo,$userid,$passwd) or die DBI->errstr; + + +$count = 0; +while ($q->param('n' . $count)) + { + $count++; + } + +$| = 1; +print "Content-type: image/png", "\n\n"; + +open CMDSTREAM, "|gnuplot"; + +print CMDSTREAM "set terminal png\n"; +print CMDSTREAM "set output\n"; +print CMDSTREAM "set xdata time\n"; +print CMDSTREAM 'set timefmt "%Y-%m-%d"'; +print CMDSTREAM "\nplot"; +for ($iter = 0; $iter < $count; $iter++) { + if ($iter) + { print CMDSTREAM ","; } + print CMDSTREAM " '-' using 1:2 with lines"; +} + +print CMDSTREAM "\n"; + +for ($iter = 0; $iter < $count; $iter++) { + + $prog = $q->param('n' . $iter); + $test = $q->param('t' . $iter); + + $query = "Select RUN, VALUE from Tests where TEST = '$test' AND NAME = '$prog' ORDER BY RUN"; + #print "\n$query\n"; + + my $sth = $dbh->prepare( $query) || die "Can't prepare statement: $DBI::errstr";; + + my $rc = $sth->execute or die DBI->errstr; + + while(($da,$v) = $sth->fetchrow_array) + { + print CMDSTREAM "$da $v\n"; + } + + print CMDSTREAM "e\n"; +} +print CMDSTREAM "exit\n"; +close CMDSTREAM; + +# disconnect from database +$dbh->disconnect; |