8. Run a Single Virtual User Test

8. Run a Single Virtual User Test

Check that your scale_factor in the Driver Script is the same as the schema you are running the test against. You can also set the Degree of Parallelism/MAXDOP directly in the script.

Figure 10.22. Modified Options

Modified Options

Double-click on create Virtual User followed by Run. This will proceed to run a single Virtual User with one Query Set.

Figure 10.23. Run a single Virtual User Test

Run a single Virtual User Test

When complete the Virtual User will show the query set time.

Figure 10.24. Single Virtual User Complete

Single Virtual User Complete

And the log will show the Query times. Note how the queries are run in a pre-determined random order.

Hammerdb Log @ Thu Apr 19 15:26:25 BST 2018
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Vuser 1:Executing Query 14 (1 of 22)
Vuser 1:query 14 completed in 9.449 seconds
Vuser 1:Executing Query 2 (2 of 22)
Vuser 1:query 2 completed in 0.235 seconds
Vuser 1:Executing Query 9 (3 of 22)
Vuser 1:query 9 completed in 16.28 seconds
Vuser 1:Executing Query 20 (4 of 22)
Vuser 1:query 20 completed in 1.254 seconds
Vuser 1:Executing Query 6 (5 of 22)
Vuser 1:query 6 completed in 1.671 seconds
Vuser 1:Executing Query 17 (6 of 22)
Vuser 1:query 17 completed in 0.63 seconds
Vuser 1:Executing Query 18 (7 of 22)
Vuser 1:query 18 completed in 10.106 seconds
Vuser 1:Executing Query 8 (8 of 22)
Vuser 1:query 8 completed in 13.784 seconds
Vuser 1:Executing Query 21 (9 of 22)
Vuser 1:query 21 completed in 46.308 seconds
Vuser 1:Executing Query 13 (10 of 22)
Vuser 1:query 13 completed in 20.612 seconds
Vuser 1:Executing Query 3 (11 of 22)
Vuser 1:query 3 completed in 1.416 seconds
Vuser 1:Executing Query 22 (12 of 22)
Vuser 1:query 22 completed in 0.808 seconds
Vuser 1:Executing Query 16 (13 of 22)
Vuser 1:query 16 completed in 2.0 seconds
Vuser 1:Executing Query 4 (14 of 22)
Vuser 1:query 4 completed in 18.848 seconds
Vuser 1:Executing Query 11 (15 of 22)
Vuser 1:query 11 completed in 6.146 seconds
Vuser 1:Executing Query 15 (16 of 22)
Vuser 1:query 15 completed in 1.886 seconds
Vuser 1:Executing Query 1 (17 of 22)
Vuser 1:query 1 completed in 12.699 seconds
Vuser 1:Executing Query 10 (18 of 22)
Vuser 1:query 10 completed in 5.707 seconds
Vuser 1:Executing Query 19 (19 of 22)
Vuser 1:query 19 completed in 1.534 seconds
Vuser 1:Executing Query 5 (20 of 22)
Vuser 1:query 5 completed in 15.7 seconds
Vuser 1:Executing Query 7 (21 of 22)
Vuser 1:query 7 completed in 6.19 seconds
Vuser 1:Executing Query 12 (22 of 22)
Vuser 1:query 12 completed in 10.954 seconds
Vuser 1:Completed 1 query set(s) in 204 seconds

8.1. Changing the Query Order

For a single virtual User test you may wish to change the query order. This query order is predetermined in the common modules. However you can redefine this function by copying and pasting the ordered_set function and modifying the order. The following example is sufficient for the single Virtual User

rename ordered_set ordered_set_orig
proc ordered_set { myposition } {
if { $myposition > 40 } { set myposition [ expr $myposition % 40 ] }
        set o_s(0)  { 14 2 9 20 6 17 18 8 21 13 3 22 16 4 11 15 1 10 19 5 7 12 }
        return $o_s($myposition)
}

and then you can change the query order as follows:

set o_s(0)  { 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 }

If your database has issues with particular queries being long running you can also remove queries this way that you do not wish to run.