diff -r 000000000000 -r 6474c204b198 tools/performance/memtest/cgi/date_reflow_form.cgi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/performance/memtest/cgi/date_reflow_form.cgi Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,106 @@ +#!/usr/bin/perl +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +#______________________________________________________________________________________ +# 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 <