Skip to content

Commit 6159924

Browse files
committed
Add key option to oltpplot, oltpdirectory
1 parent b2204ec commit 6159924

File tree

5 files changed

+72
-30
lines changed

5 files changed

+72
-30
lines changed

bin/mtitplot

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ help=no
2121
markerfile=`mktemp`
2222
trap "rm -f $markerfile" 0 int
2323
xcolor=''
24+
runnumber=0
2425

2526
while test $1 != '--'
2627
do

bin/oltpdirectory

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ help=no
2020
awr=no
2121
scalekey=''
2222
runnumber=''
23+
mykey="$RWLOLTP_NAME"
24+
wantlatest=no
2325

24-
usage="Usage: $commandname [-a|--awrdirectory] [-h|-H|--help] [-s|--scalekey key] [-r|--runnumber N] [-l|--latest]"
25-
options='aAhHs:r:l -l latest,awrdirectory,help,scalekey:,runnumber:'
26+
usage="Usage: $commandname [-a|--awrdirectory] [-h|-H|--help] [-s|--scalekey key] [-k|--key key] [-r|--runnumber N] [-l|--latest]"
27+
options='aAhHs:r:lk: -l key:,latest,awrdirectory,help,scalekey:,runnumber:'
2628

2729
# Get directory names from parameters.rwl
2830

@@ -34,19 +36,26 @@ set -- `getopt -u -n $commandname -o $options -- "$@"`
3436
while test $1 != '--'
3537
do
3638
case $1 in
37-
-l|--latest) runnumber=`rwloadsim latest.rwl`; shift;
38-
;;
3939
-r|--runnumber) runnumber=`expr 0 + $2`; shift; shift;
4040
;;
41+
-k|--key) mykey=$2; shift; shift;
42+
;;
4143
-s|--scalekey) scalekey=$2; shift; shift;
4244
;;
45+
-l|--latest) wantlatest=yes; shift;
46+
;;
4347
-a|-A|--awrdirectory) awr=yes; shift;
4448
;;
4549
--help|-h|-H) help=yes; shift;
4650
;;
4751
esac
4852
done
4953

54+
if test $wantlatest = yes
55+
then
56+
runnumber=`rwloadsim --mykey=$mykey latest.rwl`
57+
fi
58+
5059
shift # removes --
5160

5261
if test $# -ge 1 -o x$help = xyes

bin/oltpplot

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

2525
. oltp-setup-env
2626

27-
options="-o lhHX:x:c:r: -l 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] [{gnuplot range settings}]"
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}]"
2929

3030
getopt -Q $options -- "$@" || exit 1
3131
options=$(getopt -n $commandname $options -- "$@")
@@ -42,6 +42,8 @@ sesy2range=''
4242
resyrange=''
4343
ashyrange=''
4444
resy2range=''
45+
mykey="$RWLOLTP_NAME"
46+
wantlatest=no
4547

4648
while test $1 != '--'
4749
do
@@ -58,7 +60,9 @@ do
5860
;;
5961
-r) runnumber=$2; shift; shift;
6062
;;
61-
-l|--latest) runnumber=`rwloadsim latest.rwl`; shift;
63+
-k|--key) mykey=$2; shift; shift;
64+
;;
65+
-l|--latest) wantlatest=yes; shift;
6266
;;
6367
--xfile) cat $2 | while read x; do echo m $x; done >> $markerfile; shift; shift;
6468
;;
@@ -79,6 +83,11 @@ do
7983
done
8084
shift
8185

86+
if test $wantlatest = yes
87+
then
88+
runnumber=`rwloadsim --mykey=$mykey latest.rwl`
89+
fi
90+
8291
if test $help = yes
8392
then
8493
cat <<HELP

man/man2rwl/oltpdirectory.2rwl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ Output the name of the directory where gnuplot input, csv files, etc. for the
2929
latest run from the current host is found.
3030
.RE
3131
.P
32+
.B -k|--key key
33+
.RS 4
34+
Provide a key in the repository rather than the default taken from the RWLOLTP_NAME environment variable.
35+
This option is only relevant if you also use the -l or --latest option.
36+
.RE
37+
.P
3238
.B -h|-H|--help
3339
.RS 4
3440
Only output a short help.

man/man2rwl/oltpplot.2rwl

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,40 @@
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 '[ .. ]' [-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 '[ .. ]' [-k|--key key] [-l|--latest|[-r] runnumber]\fR
66
.P
77
Recreate the report that was created using
88
.B oltprun
9+
with possible changes to y-axes and/or
910
potentially adding named markers or vertical lines.
1011
.SH OPTIONS
1112
.B -h|-H|--help
1213
.RS 4
1314
Print short help.
1415
.RE
1516
.P
17+
.B --res-yrange '[ .. ]'
18+
.br
19+
.B --res-y2range '[ .. ]'
20+
.br
21+
.B --ses-yrange '[ .. ]'
22+
.br
23+
.B --ses-y2range '[ .. ]'
24+
.br
25+
.B --ash-yrange '[ .. ]'
26+
.br
27+
.RS 4
28+
By default the ranges of the left and right y-axes in the various plots are set to be "reasonable".
29+
The first two options will explicitly set different ranges in the first plot of
30+
resources (dbcpu and dbtime) on the left y-axis or throughput on the right y-axis.
31+
The second two options explicitly set different ranges in the second plot of sessions on
32+
the left y-axis (database open/active sessions)
33+
or right y-axis (instance distribution).
34+
The last option will set the left y-axis range (session count) for the ash plot.
35+
The argument to these options must be a valid gnuplot argument for a range such as [0:*], [0:20] or similar
36+
and it should typically be enclosed in quotes to prevent shell expansion.
37+
.RE
38+
.P
1639
.B -x|--xmarker 'time text'
1740
.RS 4
1841
Put a named marker on the x-axis of all relevant plots at some time.
@@ -55,34 +78,18 @@ By default, these markers and lines are printed by gnuplot using the rgb name of
5578
you can use this option to choose any other valid rgb name.
5679
.RE
5780
.P
58-
.B --res-yrange '[ .. ]'
59-
.br
60-
.B --res-y2range '[ .. ]'
61-
.br
62-
.B --ses-yrange '[ .. ]'
63-
.br
64-
.B --ses-y2range '[ .. ]'
65-
.br
66-
.B --ash-yrange '[ .. ]'
67-
.br
68-
.RS 4
69-
By default the ranges of the left and right y-axes in the various plots are set to be "reasonable".
70-
The first two options will explicitly set different ranges in the first plot of
71-
resources (dbcpu and dbtime) on the left y-axis or throughput on the right y-axis.
72-
The second two options explicitly set different ranges in the second plot of sessions on
73-
the left y-axis (database open/active sessions)
74-
or right y-axis (instance distribution).
75-
The last option will set the left y-axis range (session count) for the ash plot.
76-
The argument to these options must be a valid gnuplot argument for a range such as [0:*], [0:20] or similar
77-
and it should typically be enclosed in quotes to prevent shell expansion.
78-
.RE
79-
.P
8081
.B -l|--latest
8182
.RS 4
8283
You can provide this option as an alternative to an actual runnumber, which causes the latest
8384
run from the current host to be used.
8485
.RE
8586
.P
87+
.B -k|--key key
88+
.RS 4
89+
Provide a key in the repository rather than the default taken from the RWLOLTP_NAME environment variable.
90+
This option is only relevant if you also use the -l or --latest option.
91+
.RE
92+
.P
8693
.SH USAGE
8794
You normally don't need to call this directly; it is automatically
8895
called after each execution of \fBoltprun\fR
@@ -99,6 +106,16 @@ To create a useful string for a date representation for either option, you can c
99106
date -u +%Y.%m.%dT%H:%M:%S
100107
.fi
101108
.SH EXAMPLES
109+
If you find that your latest run was using a y-axis for the database cpu and time that was
110+
inappropriate, you can recreate the graphs using a command like
111+
.P
112+
.nf
113+
oltpplot --res-yrange='[0:20]' -l
114+
.fi
115+
.P
116+
which will cause the y-axis on the throughput and resources graph to have the range 0-20 seconds.
117+
Note that the actual range typically needs to be quoted to prevent shell expansion.
118+
.P
102119
If you had a run with number 12345 starting on 2021.12.31 just before midnight
103120
and you want to add a vertical line to the plots at exactly midnight, you
104121
can recreate the graphs using

0 commit comments

Comments
 (0)