Skip to content

Commit 8123a09

Browse files
committed
Ash includes top 8
1 parent c573de9 commit 8123a09

File tree

5 files changed

+38
-17
lines changed

5 files changed

+38
-17
lines changed

admin/rwl306.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,9 @@ create table oltpxc
3636
, constraint oltpxc_pk primary key(key, hostname)
3737
)
3838
/
39+
40+
alter table ashdata add
41+
( e7 number
42+
, e8 number
43+
)
44+
/

admin/rwloadsim.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ create table ashdata
153153
, e4 number
154154
, e5 number
155155
, e6 number
156+
, e7 number
157+
, e8 number
156158
, other number
157159
, constraint ashdata_pk
158160
primary key(runnumber, second)

oltp/ashstep1.rwl

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
# Licensed under the Universal Permissive License v 1.0
55
# as shown at https://oss.oracle.com/licenses/upl/
66

7+
# bengsig 8-may-2023 - Top 6->8 included
8+
# bengsig ??? 2019 - Creation
9+
710
# This is the first step that is done from runsys.rwl.
811
# We do little more than finding the six top ash
912
# events, save those in the rwloadsim schema
@@ -16,8 +19,8 @@
1619
#
1720
# Note that the ashdata table that will be filled in
1821
# step2 doens't have information about WHICH events
19-
# are included, it only has columns named E1 until E6.
20-
# The mapping of E1 .. E6 to event names is saved
22+
# are included, it only has columns named E1 until E8.
23+
# The mapping of E1 .. E8 to event names is saved
2124
# in the rwlash table that we insert into here
2225
# and later use in csvdata.rwl to create the final
2326
# gnuplot line
@@ -69,9 +72,11 @@ procedure ashstep1(string starttime) nostatistics
6972
writeline yt, ", nvl( E4,0)";
7073
writeline yt, ", nvl( E5,0)";
7174
writeline yt, ", nvl( E6,0)";
75+
writeline yt, ", nvl( E7,0)";
76+
writeline yt, ", nvl( E8,0)";
7277
writeline yt, ", nvl( OTHER,0)";
7378
writeline yt, "from (";
74-
writeline yt, "select sample_time_utc,CPU,E1,E2,E3,E4,E5,E6,OTHER";
79+
writeline yt, "select sample_time_utc,CPU,E1,E2,E3,E4,E5,E6,E7,E8,OTHER";
7580
writeline yt, "from (";
7681
writeline yt, "select sample_time_utc";
7782
writeline yt, ", event";
@@ -82,7 +87,7 @@ procedure ashstep1(string starttime) nostatistics
8287
writeline yt, ", decode(event";
8388
enum := 1;
8489
# stop after the top 6 events by count
85-
for evgroup at systemdb and enum <= 6 loop
90+
for evgroup at systemdb and enum <= 8 loop
8691
writeline yt, ", '"||event||"', 'E"||enum||"'";
8792
insevname;
8893
enum += 1;
@@ -105,6 +110,8 @@ procedure ashstep1(string starttime) nostatistics
105110
writeline yt, ", 'E4' as E4";
106111
writeline yt, ", 'E5' as E5";
107112
writeline yt, ", 'E6' as E6";
113+
writeline yt, ", 'E7' as E7";
114+
writeline yt, ", 'E8' as E8";
108115
writeline yt, ", 'CPU' as CPU";
109116
writeline yt, ", 'OTHER'as OTHER";
110117
writeline yt, ")))";

oltp/ashstep2.rwl

Lines changed: 7 additions & 6 deletions
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 8-may-2023 - Top 6->8 included
56
# bengsig 25-oct-2022 - External control
67
# bengsig 2019 - Creation
78

@@ -32,26 +33,26 @@ end if;
3233

3334
procedure ashstep2() nostatistics
3435
double second;
35-
integer cpu, e1, e2, e3, e4, e5, e6, other;
36+
integer cpu, e1, e2, e3, e4, e5, e6, e7, e8, other;
3637

3738
# Get the query generated in step one
3839
sql
3940
getash file resultsdir subdir runno "/getash.rws";
4041
define 1 second;
41-
define 2 cpu, 3 e1, 4 e2, 5 e3, 6 e4, 7 e5, 8 e6, 9 other;
42+
define 2 cpu, 3 e1, 4 e2, 5 e3, 6 e4, 7 e5, 8 e6, 9 e7, 10 e8, 11 other;
4243
array 100;
4344
end;
4445

4546
sql insash
4647
insert into ashdata
4748
( second, cpu
48-
, e1, e2, e3, e4, e5, e6
49+
, e1, e2, e3, e4, e5, e6, e7, e8
4950
, other
5051
, runnumber )
51-
values (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10);
52+
values (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12);
5253
bind 1 second;
53-
bind 2 cpu, 3 e1, 4 e2, 5 e3, 6 e4, 7 e5, 8 e6, 9 other;
54-
bind 10 runno;
54+
bind 2 cpu, 3 e1, 4 e2, 5 e3, 6 e4, 7 e5, 8 e6, 9 e7, 10 e8, 11 other;
55+
bind 12 runno;
5556
array 100;
5657
end;
5758

oltp/csvdata.rwl

Lines changed: 12 additions & 7 deletions
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 8-may-2023 - Ash top 6->8 included
56
# bengsig 15-mar-2022 - Add complex query wait/exec time
67
# bengsig 1-nov-2022 - --no-awr should not cause error
78
# bengsig 25-oct-2022 - Add wait/exec times per second
@@ -506,9 +507,11 @@ execute at rwloadsim
506507
||e4||' '
507508
||e5||' '
508509
||e6||' '
510+
||e7||' '
511+
||e8||' '
509512
||other||' '
510513
, cpu
511-
, e1+e2+e3+e4+e5+e6 esum
514+
, e1+e2+e3+e4+e5+e6+e7+e8 esum
512515
from ashdata
513516
where runnumber = :1
514517
order by second
@@ -522,10 +525,10 @@ execute at rwloadsim
522525
string event;
523526

524527
# The data in this table, i.e. the event names
525-
# matching E1 .. E6 comes from ashstep1.rwl
528+
# matching E1 .. E8 comes from ashstep1.rwl
526529
# We use this query both to write a comment
527530
# to the csv file such that a human will know
528-
# which events E1 .. E6 are, and to assemble
531+
# which events E1 .. E8 are, and to assemble
529532
# the plotline for gnuplot
530533
sql ashevents
531534
select '# '||to_char(enum+2,'FM9')||': '||ename
@@ -535,7 +538,7 @@ execute at rwloadsim
535538
order by enum;
536539
bind 1 runno;
537540
define 1 csvline, 2 event;
538-
array 6;
541+
array 10;
539542
end;
540543

541544
plotfile := resultsdir subdir runno "/ash.csv";
@@ -545,13 +548,13 @@ execute at rwloadsim
545548
# names
546549
integer d, lc:=1;
547550
writeline plotfile, "# columns are\n# 1: second\n# 2: CPU";
548-
sprintf plotline, "plot '%s%s%d/ash.csv' using 1:($2+$3+$4+$5+$6+$7+$8+$9) with boxes lc rgb 'gray' title 'Other'\\\n"
551+
sprintf plotline, "plot '%s%s%d/ash.csv' using 1:($2+$3+$4+$5+$6+$7+$8+$9+$10+$11) with boxes lc rgb 'gray' title 'Other'\\\n"
549552
, resultsdir,subdir,runno ;
550553
for ashevents loop
551554
writeline plotfile, csvline; # Write comment to csv file for human understanding
552555
sprintf || plotline, ", '%s%s%d/ash.csv' using 1:($2"
553556
, resultsdir,subdir,runno;
554-
for d:= lc..6 loop
557+
for d:= lc..8 loop
555558
sprintf || plotline , "+$%d",d+2;
556559
end loop;
557560
plotline ||= ") with boxes lc rgb '";
@@ -567,11 +570,13 @@ execute at rwloadsim
567570
if lc=4 then plotline ||= "blue"; end if;
568571
if lc=5 then plotline ||= "light-blue"; end if;
569572
if lc=6 then plotline ||= "salmon"; end if;
573+
if lc=7 then plotline ||= "gold"; end if;
574+
if lc=8 then plotline ||= "cyan"; end if;
570575
end if;
571576
plotline ||= "' title '" event "' \\\n";
572577
lc += 1;
573578
end loop;
574-
writeline plotfile, "# 9: Other";
579+
writeline plotfile, "# 11: Other";
575580
# note that CPU always gets a somewhat darker green
576581
plotline ||= ", '" resultsdir subdir runno "/ash.csv' using 1:2 with boxes lc rgb 'forest-green' title 'CPU'";
577582

0 commit comments

Comments
 (0)