aboutsummaryrefslogtreecommitdiffstats
path: root/utils/webNLT.pl
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2005-05-20 17:33:42 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2005-05-20 17:33:42 +0000
commit24d77506d07d3e69f65ce82d1040231797f4a5dc (patch)
tree635af7b54cc7b226c4386b55ddd2f8ba80d6c99a /utils/webNLT.pl
parent170fbcbc635f95b551d71c0e30214bf667d70cc2 (diff)
downloadexternal_llvm-24d77506d07d3e69f65ce82d1040231797f4a5dc.zip
external_llvm-24d77506d07d3e69f65ce82d1040231797f4a5dc.tar.gz
external_llvm-24d77506d07d3e69f65ce82d1040231797f4a5dc.tar.bz2
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/webNLT.pl')
-rwxr-xr-xutils/webNLT.pl80
1 files changed, 80 insertions, 0 deletions
diff --git a/utils/webNLT.pl b/utils/webNLT.pl
new file mode 100755
index 0000000..7f55b60
--- /dev/null
+++ b/utils/webNLT.pl
@@ -0,0 +1,80 @@
+#!/usr/bin/perl
+
+use DBI;
+use CGI;
+
+$q = new CGI;
+print $q->header();
+print $q->start_html(-title=>"Nightly Tester DB");
+
+unless($q->param('pwd'))
+ {
+ print $q->startform();
+ print $q->password_field(-name=>"pwd", -size=>20, -maxlength=>20);
+ print $q->submit();
+ print $q->endform();
+ }
+else
+ {
+ # 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;
+ $query = "Select DISTINCT(NAME) from Tests";
+ my $sth = $dbh->prepare($query) || die "Can't prepare statement: $DBI::errstr";
+ my $rc = $sth->execute or die DBI->errstr;
+ while (($n) = $sth->fetchrow_array)
+ {
+ push @names, ($n);
+# print "$n<P>";
+ }
+ $query = "Select DISTINCT(TEST) from Tests";
+ my $sth = $dbh->prepare($query) || die "Can't prepare statement: $DBI::errstr";
+ my $rc = $sth->execute or die DBI->errstr;
+ while (($n) = $sth->fetchrow_array)
+ {
+ push @tests, ($n);
+# print "$n\n";
+ }
+
+# print join "<BR>", @names;
+
+ print $q->startform();
+ print $q->scrolling_list(-name=>"test", -values=>\@tests, -multiple=>'true');
+ print "<P>";
+ print $q->scrolling_list(-name=>"name", -values=>\@names, -multiple=>'true');
+ print "<P>";
+ print $q->submit();
+ print $q->hidden("pwd", $q->param('pwd'));
+ print $q->endform();
+
+ # disconnect from database
+ $dbh->disconnect;
+
+ #now generate the urls to the chart
+ if ($q->param('test') && $q->param('name'))
+ {
+ my @names = $q->param('name');
+ my @tests = $q->param('test');
+ $str = "pwd=" . $q->param('pwd');
+ $count = 0;
+ while (@names)
+ {
+ $n = pop @names;
+ while (@tests)
+ {
+ $t = pop @tests;
+ $str .= "&t$count=$t&n$count=$n";
+ $count++;
+ }
+ }
+ print "<img src=\"cgiplotNLT.pl?$str\">";
+ }
+ }
+
+print $q->end_html();