Skip to content

Commit 41a2e07

Browse files
committed
oltpplot --gnuplot-extra option
1 parent a25ef6f commit 41a2e07

File tree

3 files changed

+45
-6
lines changed

3 files changed

+45
-6
lines changed

bin/oltpplot

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
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
@@ -24,8 +25,8 @@
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

3031
getopt -Q $options -- "$@" || exit 1
3132
options=$(getopt -n $commandname $options -- "$@")
@@ -42,12 +43,23 @@ sesy2range=''
4243
resyrange=''
4344
ashyrange=''
4445
resy2range=''
46+
gnuplotextra=''
47+
noawrinterval=''
4548
mykey="$RWLOLTP_NAME"
4649
wantlatest=no
4750

4851
while test $1 != '--'
4952
do
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;
@@ -62,6 +74,8 @@ do
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;
@@ -86,6 +100,7 @@ shift
86100
if test $wantlatest = yes
87101
then
88102
runnumber=`rwloadsim --mykey=$mykey latest.rwl`
103+
echo oltpplot: latest runnumber for $mykey is $runnumber
89104
fi
90105

91106
if 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
104121
time for -x|-X is either YYYY.MM.DD"T"HH24:MI:SS or a number of seconds
105122
HELP
@@ -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
166183
else
167184
rwloadsim -q -i runperiod:=$runperiod -i runno:=$runnumber \
168-
--starttime=$starttime csvdata.rwl || exit 1
185+
--starttime=$starttime $noawrinterval csvdata.rwl || exit 1
169186
fi
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
197214
END
198215

216+
if test ! -z "$gnuplotextra"
217+
then
218+
cat $gnuplotextra >> $resultsdir$subdir$runnumber/header.plot
219+
fi
220+
199221
cat $resultsdir$subdir$runnumber/header.plot >> $resultsdir$subdir$runnumber/res.plot
200222

201223
cp $resultsdir$subdir$runnumber/header.plot $resultsdir$subdir${runnumber}/instdist.plot

man/man2rwl/oltpplot.2rwl

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.SH NAME
33
oltpplot \- Create html and graphics for a single run
44
.SH SYNOPSIS
5-
\fBoltpplot [--xfile|--Xfile filename] [-x|-X|--xmarker|--xline 'time text'] [-c|--xcolor rgbname] [--ses-y{2}range '[ .. ]' [--res-y{2}range '[ .. ]' --ash-yrange '[ .. ]' [-k|--key key] [-l|--latest|[-r] runnumber]\fR
5+
\fBoltpplot [--xfile|--Xfile filename] [-x|-X|--xmarker|--xline 'time text'] [-c|--xcolor rgbname] [--ses-y{2}range '[ .. ]'] [--res-y{2}range '[ .. ]'] [--ash-yrange '[ .. ]'] [--gnuplot-extra file] [--no-awr-interval] [-k|--key key] [-l|--latest|[-r] runnumber]\fR
66
.P
77
Recreate the report that was created using
88
.B oltprun
@@ -78,6 +78,21 @@ By default, these markers and lines are printed by gnuplot using the rgb name of
7878
you can use this option to choose any other valid rgb name.
7979
.RE
8080
.P
81+
.B --gnuplot-extra file
82+
.RS 4
83+
The contents of the named file will be added as extra contents to all gnuplot input files.
84+
It can contain any valid gnuplot commands and can be used to add any extra decoration
85+
to the generated graphics.
86+
.RE
87+
.P
88+
.B --no-awr-interval
89+
.RS 4
90+
By default, all generated graphics will indicate the time taken to do the initial and finishing
91+
awr snapshots.
92+
This option turns that graphics off.
93+
.RE
94+
.P
95+
.P
8196
.B -l|--latest
8297
.RS 4
8398
You can provide this option as an alternative to an actual runnumber, which causes the latest

oltp/csvdata.rwl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Licensed under the Universal Permissive License v 1.0
33
# as shown at https://oss.oracle.com/licenses/upl/
44

5+
# bengsig 22-nov-2023 - Add --no-awr-interval
56
# bengsig 26-sep-2023 - Add timestamps to cli.csv
67
# bengsig 1-aug-2023 - Add oltpxcset markers from oltpxcrun
78
# bengsig 31-jul-2023 - Add experimental 24h simulation
@@ -31,6 +32,7 @@ string(1000) oerreverse;
3132
string(1000) markerfile; $useroption:markerfile
3233
private string starttime; $useroption:starttime
3334
private string xcolor := "blue"; $useroption:xcolor
35+
private integer no_awr_interval := 0; $userswitch:no-awr-interval
3436

3537
# This function takes a string that must be either
3638
# in DDDD.MM.YYYY"T"HH24:MI:SS format or must be
@@ -182,7 +184,7 @@ execute at rwloadsim
182184
if oraerror != 1403 then
183185
writeline stderr, "csvdata.rwl: getting awr markers: " oraerrortext;
184186
end;
185-
else
187+
elseif !no_awr_interval then
186188
writeline plotfile, "# awr markers:";
187189
writeline plotfile,
188190
"set arrow from " bb ", graph -0.01 to " be ", graph -0.01 lc rgb 'dark-red' heads size graph 0.005,90";

0 commit comments

Comments
 (0)