Skip to content

Commit

Permalink
- generate also *-trend-detailed.svg and png with the last 2 weeks
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@24816 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Feb 27, 2015
1 parent 8f626cb commit 91927af
Showing 1 changed file with 34 additions and 3 deletions.
37 changes: 34 additions & 3 deletions Examples/PlotLibraryTrend.sh
Expand Up @@ -11,10 +11,14 @@ LIB="$2"
test -d "$HISTORY"

FIRST_DATE=`grep -H "Simulation Results:" "$HISTORY/${LIB}"-*.html | head -n1 | cut -d: -f1 | grep -o "20[0-9-]*"`
FIRST_DATE_DETAILED=`grep -H "Simulation Results:" "$HISTORY/${LIB}"-*.html | tail -n14 | head -n1 | cut -d: -f1 | grep -o "20[0-9-]*"`
LAST_DATE=`grep -H "Simulation Results:" "$HISTORY/${LIB}"-*.html | tail -n1 | cut -d: -f1 | grep -o "20[0-9-]*"`
if test "$FIRST_DATE" = "$LAST_DATE"; then
FIRST_DATE="1970-01-01"
fi
if test "$FIRST_DATE_DETAILED" = "$LAST_DATE"; then
FIRST_DATE_DETAILED="1970-01-01"
fi
GOAL=`grep -H "Simulation Results:" "$HISTORY/${LIB}"-*.html | tail -n1 | grep -o "[0-9][0-9]*/[0-9][0-9]*" | sed s,.*/,,`
CURS=`grep -H "Simulation Results:" "$HISTORY/${LIB}"-*.html | tail -n1 | grep -o "[0-9][0-9]*/[0-9][0-9]*" | sed s,/.*,,`
CURC=`grep -H "BuildModel Results:" "$HISTORY/${LIB}"-*.html | tail -n1 | grep -o "[0-9][0-9]*/[0-9][0-9]*" | sed s,/.*,,`
Expand All @@ -25,7 +29,6 @@ set xlabel "Date $FIRST_DATE - $LAST_DATE"
set ylabel "Models"
set xdata time
set timefmt "%Y-%m-%d"
#set xrange ["2012-10-17":"2012-11-22"]
set format x "%m-%d"
set xrange ["$FIRST_DATE":"$LAST_DATE"]
# set yrange [0:$(( (($GOAL+9)/10)*10 ))]
Expand All @@ -45,6 +48,33 @@ plot "${LIB}-trend.csv" using 1:2 title 'Target: $GOAL' with lines ls 1, \
"${LIB}-trend.csv" using 1:3 title 'Compile: $CURC' with lines ls 2, \
"${LIB}-trend.csv" using 1:4 title 'Simulate: $CURS' with lines ls 3
EOF

cat > "$HISTORY/${LIB}-trend-detailed.gnuplot" <<EOF
set term png
set datafile separator ","
set xlabel "Date $FIRST_DATE_DETAILED - $LAST_DATE"
set ylabel "Models"
set xdata time
set timefmt "%Y-%m-%d"
set format x "%m-%d"
set xrange ["$FIRST_DATE_DETAILED":"$LAST_DATE"]
# set yrange [0:$(( (($GOAL+9)/10)*10 ))]
set yrange [0:]
# set ytics 10
# set xtics rotate by -13 font "Helvetica,8"
set title '$LIB Detailed Coverage'
set output "${LIB}-trend-detailed.png"
goal(x) = $GOAL
currentC(x) = $CURC
currentS(x) = $CURS
set key right bottom Left title 'Legend'
set style line 1 linecolor rgb "red" pt 1 ps 1
set style line 2 linecolor rgb "blue" pt 1 ps 1
set style line 3 linecolor rgb "green" pt 1 ps 1
plot "${LIB}-trend.csv" using 1:2 title 'Target: $GOAL' with lines ls 1, \
"${LIB}-trend.csv" using 1:3 title 'Compile: $CURC' with lines ls 2, \
"${LIB}-trend.csv" using 1:4 title 'Simulate: $CURS' with lines ls 3
EOF
rm -f "$HISTORY/${LIB}"-trend.csv
for f in `grep -H "Simulation Results:" "$HISTORY/${LIB}"-*.html | cut -d: -f1` ; do
DATE=`echo "$f" | grep -o "20[0-9-]*"`
Expand All @@ -55,6 +85,7 @@ for f in `grep -H "Simulation Results:" "$HISTORY/${LIB}"-*.html | cut -d: -f1`
REV=`grep -o "[(]r[0-9]*" "$f" | tr -d "("`
echo "$DATE,$TOT,$BUILD,$SIMSUC" >> "$HISTORY/${LIB}-trend.csv"
done
(cd "$HISTORY"; gnuplot "${LIB}-trend.gnuplot")
(cd "$HISTORY"; gnuplot "${LIB}-trend.gnuplot" ; gnuplot "${LIB}-trend-detailed.gnuplot")
sed -i s/png/svg/ "$HISTORY/${LIB}-trend.gnuplot"
(cd "$HISTORY"; gnuplot "${LIB}-trend.gnuplot")
sed -i s/png/svg/ "$HISTORY/${LIB}-trend-detailed.gnuplot"
(cd "$HISTORY"; gnuplot "${LIB}-trend.gnuplot"; gnuplot "${LIB}-trend-detailed.gnuplot")

0 comments on commit 91927af

Please sign in to comment.