adding 3 more test for the performance suite.
[arvados.git] / jenkins / create-plot-data-from-log.sh
1 #!/bin/bash 
2
3 build=$1
4 file=$2
5 outputdir=$3
6
7 usage() {
8     echo "./$0 build_number file_to_parse output_dir"
9     echo "this script will use the build output to generate *csv and *txt"
10     echo "for jenkins plugin plot https://github.com/jenkinsci/plot-plugin/"
11 }
12
13 if [ $# -ne 3 ]
14 then
15     usage 
16     exit 1
17 fi
18
19 if [ ! -e $file ]
20 then
21     usage
22     echo "$file doesn't exists! exiting"
23     exit 2
24 fi
25 if [ ! -w $outputdir ]
26 then
27     usage
28     echo "$outputdir isn't writeable! exiting"
29     exit 3
30 fi
31
32 #------------------------------
33 ## max lines that a test will output
34 MAXLINES=1000 
35
36 ## TODO: check $build and $file make sense
37
38 for test in \
39  test_Collection_page_renders_name \
40  test_combine_selected_collections_into_new_collection \
41  test_combine_selected_collection_files_into_new_collection_active_foo_collection_in_aproject_true \
42  test_combine_selected_collection_files_into_new_collection_active_foo_file_false \
43  test_combine_selected_collection_files_into_new_collection_project_viewer_foo_collection_in_aproject_false \
44  test_combine_selected_collection_files_into_new_collection_project_viewer_foo_file_false \
45  test_Create_and_show_large_collection_with_manifest_text_of_20000000 \
46  test_Create__show__and_update_description_for_large_collection_with_manifest_text_of_100000 \
47  test_Create_one_large_collection_of_20000000_and_one_small_collection_of_10000_and_combine_them
48 do
49  zgrep -A$MAXLINES "^CollectionsTest: $test" $file | tail --lines=+3|grep -B$MAXLINES -E "^-*$" -m1 > $outputdir/$test-$build.txt
50  echo processing  $outputdir/$test-$build.txt creating  $outputdir/$test.csv
51  echo $(grep ^Completed $test-$build.txt | perl -n -e '/^Completed (.*) in [0-9]+ms.*$/;print "".++$line."-$1,";' | perl -p -e 's/,$//g'|tr " " "_" ) >  $outputdir/$test.csv
52  echo $(grep ^Completed $test-$build.txt | perl -n -e '/^Completed.*in ([0-9]+)ms.*$/;print "$1,";' | perl -p -e 's/,$//g' ) >>  $outputdir/$test.csv
53  #echo URL=https://ci.curoverse.com/view/job/arvados-api-server/ws/apps/workbench/log/$test-$build.txt/*view*/ >>  $outputdir/$test.properties
54 done