55
66# Changes:
77#
8+ # 22-nov-2023 bengsig Add --gnuplot-extra
89# 23-sep-2023 bengsig Add timestamps to res.plot and ping.plot
910# 9-aug-2023 bengsig Add --ses-yrange, --ses-y2range
1011# 1-aug-2023 bengsig Add oltpxcset markers from oltpxcrun
2425
2526. oltp-setup-env
2627
27- options=" -o lhHX:x:c:r:k: -l key:,xfile:,Xfile:,latest,help,xmarker:,xline:,xcolor:,ses-y2range:,ses-yrange:,ash-yrange:,res-yrange:,res-y2range:"
28- usage=" $commandname [-x|-X|--xmarker|--xline 'time text'] [--xcolor=rgbname] [-l|--latest|[-r] runnumber] [-k|--key key] [{gnuplot range settings}]"
28+ options=" -o lhHX:x:c:r:k: -l no-awr-interval, key:,xfile:,Xfile:,latest,help,xmarker:,xline:,xcolor:,ses-y2range:,ses-yrange:,ash-yrange:,res-yrange:,res-y2range:,gnuplot-extra :"
29+ usage=" $commandname [-x|-X|--xmarker|--xline 'time text'] [--xcolor=rgbname] [-l|--latest|[-r] runnumber] [-k|--key key] [{gnuplot range/extra settings}]"
2930
3031getopt -Q $options -- " $@ " || exit 1
3132options=$( getopt -n $commandname $options -- " $@ " )
@@ -42,12 +43,23 @@ sesy2range=''
4243resyrange=' '
4344ashyrange=' '
4445resy2range=' '
46+ gnuplotextra=' '
47+ noawrinterval=' '
4548mykey=" $RWLOLTP_NAME "
4649wantlatest=no
4750
4851while test $1 ! = ' --'
4952do
5053 case $1 in
54+ --gnuplot-extra)
55+ if test -r $2
56+ then
57+ gnuplotextra=$2
58+ else
59+ echo " oltpplot: Cannot read $2 - --gnuplot-extra will be ignored" 2>&1
60+ fi
61+ shift ; shift ;
62+ ;;
5163 --ses-y2range) sesy2range=" $2 " ; shift ; shift ;
5264 ;;
5365 --ses-yrange) sesyrange=" $2 " ; shift ; shift ;
6274 ;;
6375 -k|--key) mykey=$2 ; shift ; shift ;
6476 ;;
77+ --no-awr-interval) noawrinterval=' --no-awr-interval' ; shift ;
78+ ;;
6579 -l|--latest) wantlatest=yes; shift ;
6680 ;;
6781 --xfile) cat $2 | while read x; do echo m $x ; done >> $markerfile ; shift ; shift ;
86100if test $wantlatest = yes
87101then
88102 runnumber=` rwloadsim --mykey=$mykey latest.rwl`
103+ echo oltpplot: latest runnumber for $mykey is $runnumber
89104fi
90105
91106if test $help = yes
@@ -100,6 +115,8 @@ Usage: $usage
100115--ses-yrange '[ .. ]' : Set gnuplot yrange for database open/active counts
101116--ses-y2range '[ .. ]' : Set gnuplot y2range for instance distribution
102117--ash-yrange '[ .. ]' : Set gnuplot yrange for sessions in ash plot
118+ --gnuplot-extra file : Add the contents of file to all graphs
119+ --no-awr-interval : Do not indicate the intervals for awr snapshot generation
103120-h|-H|--help : Print this help
104121time for -x|-X is either YYYY.MM.DD"T"HH24:MI:SS or a number of seconds
105122HELP
@@ -162,10 +179,10 @@ then
162179 cp $markerfile $resultsdir$subdir$runnumber /csvmarkers.input
163180 rwloadsim -q -i runperiod:=$runperiod -i runno:=$runnumber \
164181 $xcolor --markerfile=$markerfile --starttime=$starttime \
165- csvdata.rwl || exit 1
182+ $noawrinterval csvdata.rwl || exit 1
166183else
167184 rwloadsim -q -i runperiod:=$runperiod -i runno:=$runnumber \
168- --starttime=$starttime csvdata.rwl || exit 1
185+ --starttime=$starttime $noawrinterval csvdata.rwl || exit 1
169186fi
170187
171188# re-read env file as csvdata may have added a new runperiod value
@@ -196,6 +213,11 @@ cat >> $resultsdir$subdir$runnumber/header.plot << END
196213 set rmargin at screen 0.9
197214END
198215
216+ if test ! -z " $gnuplotextra "
217+ then
218+ cat $gnuplotextra >> $resultsdir$subdir$runnumber /header.plot
219+ fi
220+
199221cat $resultsdir$subdir$runnumber /header.plot >> $resultsdir$subdir$runnumber /res.plot
200222
201223cp $resultsdir$subdir$runnumber /header.plot $resultsdir$subdir ${runnumber} /instdist.plot
0 commit comments