From 825a0c93a70659b44b89eac4474e83f66b1fd891 Mon Sep 17 00:00:00 2001 From: "curt%scruznet.com" Date: Wed, 25 Apr 2001 20:25:57 +0000 Subject: [PATCH] Initial checkin git-svn-id: svn://10.0.0.236/trunk@93087 18797224-902f-48f8-a5cc-f745e15eee43 --- .../memtest/cgi/date_reflow_form.cgi | 102 +++++++++++++ .../memtest/cgi/list_reflow_form.cgi | 85 +++++++++++ .../performance/memtest/cgi/memtest_form.cgi | 142 ++++++++++++++++++ 3 files changed, 329 insertions(+) create mode 100755 mozilla/tools/performance/memtest/cgi/date_reflow_form.cgi create mode 100755 mozilla/tools/performance/memtest/cgi/list_reflow_form.cgi create mode 100755 mozilla/tools/performance/memtest/cgi/memtest_form.cgi diff --git a/mozilla/tools/performance/memtest/cgi/date_reflow_form.cgi b/mozilla/tools/performance/memtest/cgi/date_reflow_form.cgi new file mode 100755 index 00000000000..78ae471bd04 --- /dev/null +++ b/mozilla/tools/performance/memtest/cgi/date_reflow_form.cgi @@ -0,0 +1,102 @@ +#!/usr/bin/perl + +#______________________________________________________________________________________ +# these variables will need to be changed to fit the host machine configuration/directories. +# +# this is where the linux.dat files live; currently /home/usr/ftp/pub/data/memtests + $directory_root = "/u/curt/reflow/results/"; +# + $host_server = "smoketest1"; +# +# note: the /plots_tmp directory under $results_dir will need to be cleaned out periodically +# because this is where the .png files will be put on creation (it could become a memory hog) + $results_dir = "/usr/local/apache/htdocs"; + +# this is where gnuplot app lives + $gnuplot = "/usr/bin/gnuplot"; +# +#-------------------------------------------------------------------------------------- + +# take in form info and convert it to usable variables -------------------------------- + +$query_string = $ENV{'QUERY_STRING'}; +#$query_string = "first_date=04%2F17%2F01&compare_date=04%2F12%2F01"; + +@key_value_pairs = split (/&/, $query_string); + +foreach $key_value (@key_value_pairs) + { + ($key, $value) = split (/=/, $key_value); + $value =~ tr/+/ /; + $value =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex ($1))/eg; + $form_data{$key} = $value; + @list_keys = keys(%form_data); + @values_keys = values(%form_data); + } + +# error check for user selecting both fields ------------------------------------ + +$number_of_values = @key_value_pairs; + +if ($number_of_values != 2) { + print "Content-type: text/html", "\n\n"; + + print "", "\n"; + print "Plotting Error", "\n"; + print "", "\n"; + print "

", "Plotting Error", "

", "
", "\n"; + print "Please make a selection from each of the date fields in the green form.", "\n"; + print "", "\n"; + } + +# create variables to point to directories containg the reflow.dat files --------------- + +else { + ($month, $day, $year) = split (/\//, $form_data{"first_date"}); + $first_date = "$year$month$day"; + ($month, $day, $year) = split (/\//, $form_data{"compare_date"}); + $compare_date = "$year$month$day"; + $first_date_dir = join ("/",$directory_root , $test_list, $first_date, "reflow.dat"); + $compare_date_dir = join ("/", $directory_root, $test_list, $compare_date, "reflow.dat"); + + +# generate gnuplot graph -------------------------------------------------------------- + + $process_id = $$; + $output_file = join ("", $results_dir, "/plots_tmp/", $process_id, ".png"); + $output_location = join ("", "http://", $host_server, "/plots_tmp/", $process_id, ".png"); + open(GNUPLOT, "|$gnuplot"); + print GNUPLOT <", "\n"; + print "Plotting Error", "\n"; + print "", "\n"; + print "

", "Plotting Error", "

", "
", "\n"; + print "Please make a selection from each field in the yellow from.", "\n"; + print "", "\n"; + } + +# create variables to point to directories containg the data files --------------- + +else { + ($month, $day, $year) = split (/\//, $form_data{"date"}); + $dir_date = "$year$month$day"; + $data_in = $form_data{"data"}; + if ($data_in eq "Reflows per URL") { + $data_list = "results"; + } + elsif ($data_in eq "Detailed Results") { + $data_list = "reflow.out"; + } + + $output_location = join ("/", "ftp:/", $host_server, "pub/data/reflows", $dir_date, $data_list); + +# send text to users browser---------------------------------------------------------- + + print "Location: $output_location", "\n\n"; + + } +#end if + +exit (0); + + + + + + + + + + + + diff --git a/mozilla/tools/performance/memtest/cgi/memtest_form.cgi b/mozilla/tools/performance/memtest/cgi/memtest_form.cgi new file mode 100755 index 00000000000..3acf19f106e --- /dev/null +++ b/mozilla/tools/performance/memtest/cgi/memtest_form.cgi @@ -0,0 +1,142 @@ +#!/usr/bin/perl + +#______________________________________________________________________________________ +# these variables will need to be changed to fit the host machine configuration/directories. +# +# this is where the linux.dat files live; currently /home/usr/ftp/pub/data/memtests + $directory_root = "/u/twalker/memtest/results/daily"; +# + $host_server = "smoketest1"; +# +# note: the /plots_tmp directory under $results_dir will need to be cleaned out periodically +# because this is where the .png files will be put on creation (it could become a memory hog) + $results_dir = "/usr/local/apache/htdocs"; + +# this is where gnuplot app lives + $gnuplot = "/usr/bin/gnuplot"; +# +#-------------------------------------------------------------------------------------- + +# take in form info and convert it to usable variables -------------------------------- + +$query_string = $ENV{'QUERY_STRING'}; + +@key_value_pairs = split (/&/, $query_string); + +foreach $key_value (@key_value_pairs) + { + ($key, $value) = split (/=/, $key_value); + $value =~ tr/+/ /; + $value =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex ($1))/eg; + $form_data{$key} = $value; + @list_keys = keys(%form_data); + @values_keys = values(%form_data); + } + +# error check for user selecting all three fields ------------------------------------ + +$number_of_values = @key_value_pairs; + +if ($number_of_values != 3) { + print "Content-type: text/html", "\n\n"; + + print "", "\n"; + print "Plotting Error", "\n"; + print "", "\n"; + print "

", "Plotting Error", "

", "
", "\n"; + print "Please close this window and make a selection from each of the three fields.", "\n"; + print "", "\n"; + } + +# create variables to point to directories containg the linux.dat files --------------- + +else { + ($month, $day, $year) = split (/\//, $form_data{"first_date"}); + $first_date = "$year$month$day"; + ($month, $day, $year) = split (/\//, $form_data{"compare_date"}); + $compare_date = "$year$month$day"; + $test_list_in = $form_data{"test_list"}; + if ($test_list_in eq "large to small") { + $test_list = "static41x3_gtol"; + } + elsif ($test_list_in eq "small to large") { + $test_list = "static41x3_ltog"; + } + elsif ($test_list_in eq "plain text") { + $test_list = "static_vanillaX100"; + } + elsif ($test_list_in eq "memory hog") { + $test_list = "static_iplanetX100"; + } + + open(FIRST_DATE_DIR,"$directory_root/$test_list/$first_date/linux.dat") || die "could not create directory\n"; + open(COMPARE_DATE_DIR,"$directory_root/$test_list/$compare_date/linux.dat") || die "could not create directory\n"; + $first_date_dir = join ("/",$directory_root , $test_list, $first_date, "linux.dat"); + $compare_date_dir = join ("/", $directory_root, $test_list, $compare_date, "linux.dat"); + +# get slope of first date line--------------------------------------------------------- + + while () { + $line = $_; + } + @slope_array_first = split (' ',$line); + $slope_first = $slope_array_first[1]; + $label_placement_first = $slope_array_first[5]; + $line_formula_first = join (" ", $slope_array_first[3], $slope_array_first[2], $slope_array_first[1], $slope_array_first[4], $slope_array_first[5]); + chop($slope_first);chop($slope_first);chop($slope_first); + close (FIRST_DATE_DIR); + +# get slope of compare date line--------------------------------------------------------- + + while () { + $line = $_; + } + @slope_array_compare = split (' ',$line); + $slope_compare = $slope_array_compare[1]; + $label_placement_compare = $slope_array_compare[5]; + $line_formula_compare = join (" ", $slope_array_compare[3], $slope_array_compare[2], $slope_array_compare[1], $slope_array_compare[4], $slope_array_compare[5]); + chop($slope_compare);chop($slope_compare);chop($slope_compare); + close(COMPARE_DATE_DIR); + +# generate gnuplot graph -------------------------------------------------------------- + + $process_id = $$; + $output_file = join ("", $results_dir, "/plots_tmp/", $process_id, ".png"); + $output_location = join ("", "http://", $host_server, "/plots_tmp/", $process_id, ".png"); + open(GNUPLOT, "|$gnuplot"); + print GNUPLOT <