-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathrunsimulation.rwl
58 lines (47 loc) · 1.23 KB
/
runsimulation.rwl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# We want statistics
$statistics:all
$include:"rwloadsim.rwl"
# And awr
$include:"awrdemo.rwl"
# Our real execution user
$include:"demouser.rwl"
# And the code we are simulating
$include:"insertdemo.rwl"
$include:"querydemo.rwl"
# Some settings that can be overwritten
integer thrcount := 5; $useroption:thrcount
double totaltime := 60; $useroption:totaltime
# make 25% inserts 65% queries, 10% complex queries
random procedure array doeither
( insorder 25
, selorder 65
, qcomplex 10
);
# Yes, we want by default awr
integer doawr := 1; $userswitch:doawr
run
# Start a number of real worker threads
threads thrcount # start 20 threads
at demouser # Using this database
for
every erlang2(0.05) # simulate arrival rate of 20 per second
stop totaltime # this many times
loop
doeither(); # executing this
end;
end;
# Use one thread to gather and make awr
threads !!doawr # make sure 0 or 1 threads start
at awruser
# begin 5 seconds into run
wait(5);
beginawr();
# end 5 seconds before finish
wait(totaltime-runseconds-5);
makeawr();
end;
end;
showcounts(); # to show total
qshowcounts(); # to show total
cshowcounts(); # to show total
printline "runnumber:", runnumber;