diff --git a/mozilla/webtools/graph/query.cgi b/mozilla/webtools/graph/query.cgi index 4daac2b4c94..fd083dea01e 100755 --- a/mozilla/webtools/graph/query.cgi +++ b/mozilla/webtools/graph/query.cgi @@ -14,7 +14,9 @@ my $SIZE = lc($req->param('size')); my $DAYS = lc($req->param('days')); my $LTYPE = lc($req->param('ltype')); my $POINTS = lc($req->param('points')); -# +my $AVG = lc($req->param('avg')); + + # Testing only: # #$TESTNAME = "testname"; @@ -43,12 +45,14 @@ sub make_filenames_list { # Print out a list of testnames in db directory sub print_testnames { - my ($tbox, $autoscale, $days, $units, $ltype, $points) = @_; + my ($tbox, $autoscale, $days, $units, $ltype, $points, $avg) = @_; # HTTP header print "Content-type: text/html\n\n\n"; + print "testnames"; print "

testnames

"; + print "

"; print ""; print "
Select one of the following tests:
\n"; @@ -58,7 +62,7 @@ sub print_testnames { my $machines_string = join(" ", @machines); foreach (@machines) { - print "
  • $_\n"; + print "
  • $_\n"; } print "
  • "; @@ -67,7 +71,7 @@ sub print_testnames { # Print out a list of machines in db/ directory, with links. sub print_machines { - my ($testname, $autoscale, $days, $units, $ltype, $points) = @_; + my ($testname, $autoscale, $days, $units, $ltype, $points, $avg) = @_; # HTTP header print "Content-type: text/html\n\n\n"; @@ -82,7 +86,7 @@ sub print_machines { my $machines_string = join(" ", @machines); foreach (@machines) { - print "

  • $_\n"; + print "
  • $_\n"; } print ""; @@ -96,6 +100,9 @@ sub show_graph { print "\n"; + # JS refresh every 30min + print "\n"; + print "\n"; print "\n"; @@ -104,11 +111,11 @@ sub show_graph { print "\n"; if($AUTOSCALE) { print "Y-axis: (zoom|"; - print "100%"; + print "100%"; print ") \n"; } else { print "Y-axis: ("; - print "zoom"; + print "zoom"; print "|100%) \n"; } print "\n"; @@ -116,7 +123,7 @@ sub show_graph { # Days, Time-axis print "\n"; + + # Average (on|off) + print "\n"; + + print "\n"; + print "
    \n"; - print "
    \n"; + print "\n"; print "\n"; print ""; print ""; @@ -125,10 +132,11 @@ sub show_graph { print ""; print ""; print ""; + print ""; print "Days:"; if($DAYS) { - print "(all data|"; + print "(all data|"; print ""; print ")\n"; } else { @@ -146,12 +154,12 @@ sub show_graph { print "Style:"; if($LTYPE eq "steps") { print "("; - print "lines"; + print "lines"; print "|steps"; print ")"; } else { print "(lines|"; - print "steps"; + print "steps"; print ")"; } print "\n"; @@ -163,22 +171,42 @@ sub show_graph { print "Points:"; if($POINTS) { print "(on|"; - print "off"; + print "off"; print ")\n"; } else { print "("; - print "on"; + print "on"; print "|off)\n"; } print "\n"; print "
    \n"; + print "\n"; + print "Average:"; + if($AVG) { + print "(on|"; + print "off"; + print ")\n"; + } else { + print "("; + print "on"; + print "|off)\n"; + } + print "\n"; + print "
    \n"; print "
    \n"; + # graph - print "\"$TBOX"; + print "\"$TBOX"; print "
    \n"; print "
    \n"; @@ -192,11 +220,11 @@ sub show_graph { # Other machines print ""; print "
  • \n"; - print "Other machines running the $TESTNAME test"; + print "Other machines running the $TESTNAME test"; print "
  • \n"; print "
  • \n"; - print "Other tests that $TBOX is running"; + print "Other tests that $TBOX is running"; print "
  • \n"; print "
  • \n"; @@ -219,7 +247,7 @@ sub show_graph { # Graph size print "\n"; - print "\n"; + print "\n"; print "\n"; print ""; print ""; @@ -251,9 +279,9 @@ sub show_graph { # main { if(!$TESTNAME) { - print_testnames($TBOX, $AUTOSCALE, $DAYS, $UNITS, $LTYPE, $POINTS); + print_testnames($TBOX, $AUTOSCALE, $DAYS, $UNITS, $LTYPE, $POINTS, $AVG); } elsif(!$TBOX) { - print_machines($TESTNAME, $AUTOSCALE, $DAYS, $UNITS, $LTYPE, $POINTS); + print_machines($TESTNAME, $AUTOSCALE, $DAYS, $UNITS, $LTYPE, $POINTS, $AVG); } else { show_graph(); }