SQL Server - Automate Tests on Windows #84
-
Hello Everyone! I am currently trying to create a script to test a bunch of SQL Servers in a new hardware and for that I want to use HammerDB. So far I was able to create the script to build up the schema, which I have named
This is working perfectly when I invoke a Now, I am trying to automate the second part, which is to load the script, create the virtual users and perform the workload test against the created schema/data. For this step in specific I have created the following script, which I took from the documentation.
This second part somehow is not working when I try to run `hammerdbcli.bat auto loadtest.tcl'. I am certain that I am doing something wrong, I just don't know what. I appreciate any responses to this. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Hi, You have a mix of the build and driver scripts in the driver one. in particular you call a function called runtimer but don't include that in the script. So there are a couple of examples below for build and driver tested here that should provide you with a template. A few things to note. Firstly these scripts are multithreaded so once you do build schema and vurun it is running multiple threads. We need a different approach for both because in the schema build we are waiting for all of the virtual users to finish (vwait forever), however for the driver we are waiting for a set period of time before terminating them. For the build I have created more warehouses but with 5 virtual users to show the multithreaded nature of the build. For the driver we have set a rampup and duration of 3 minutes in total (180 secs) - this runs in the virtual users, then in the main monitor virtual user it runs a timer - this is set to 200 seconds more than the rampup and driver combined (if it is less it will terminate the test before ending). With both I copied the scripts to C:\Program Files\HammerDB-3.3. I then did:
and
When both are complete the shell will exit as intended. Build Script - autorunbuild.tcl
Driver Script - autorundrive.tcl
|
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for that @sm-shaw. Interesting enough I had some problems when editing the .tcl files from different editors, but that is of course something on my side. I will explore different parameters and configurations, but that gives me at least a good starting point. |
Beta Was this translation helpful? Give feedback.
-
For an editor on Windows with TCL language syntax colorisation I would recommend vim that can be found here https://www.vim.org/. Using vim you should not have any issues editing files to run in HammerDB. |
Beta Was this translation helpful? Give feedback.
-
A copy of these scripts has been posted here https://www.hammerdb.com/blog/uncategorized/automating-cli-tests-on-windows/ |
Beta Was this translation helpful? Give feedback.
Hi,
You have a mix of the build and driver scripts in the driver one. in particular you call a function called runtimer but don't include that in the script. So there are a couple of examples below for build and driver tested here that should provide you with a template.
A few things to note. Firstly these scripts are multithreaded so once you do build schema and vurun it is running multiple threads. We need a different approach for both because in the schema build we are waiting for all of the virtual users to finish (vwait forever), however for the driver we are waiting for a set period of time before terminating them. For the build I have created more warehouses but with 5 virtual user…