-
Hi! This is my first time using HammerDB and I am trying to setup a test for a PostgreSQL database. I have already been able to use HammerDB with a simple setup. However, I would like to run a custom script in parallel as well. I am using a schema versioning tool called Liquibase. Liquibase allows me to run a command like: What I would like to do:
Is there a way to do this? Additionally, I would like to output some metrics (such as the latency and throughput) to a file, so I can create a chart out of them. How would I go about that? Thank you for your help in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, So you will want to be running a timed test and here virtual user 1 is the monitor virtual user. So for example in the GUI look in the script editor that is loaded for PostgreSQL and find the following timing section. In this example, it is modified to print out "running bespoke command after 2 mins" after 2 minutes. So you can put anything you want in here - to execute an external command use "exec", for SQL commands, see examples later in the driver script.
This gives output as follows
If you want to load a custom script in the CLI use the customscript command. note you can write and test it in the GUI and then save it and load it in the CLI for ease of use. For latency, see the documentation on time profiling - this is a very comprehensive way to capture all the transaction latencies you need. For throughput, see logging transaction counter output https://www.hammerdb.com/docs/ch06s08.html Also you can view PostgreSQL statistics over time with the graphical metrics viewer |
Beta Was this translation helpful? Give feedback.
Hi,
HammerDB is multithreaded, and the virtual users already run in parallel. Also, it is scripted for exactly this reason, so you change the test scenario however you wish.
So you will want to be running a timed test and here virtual user 1 is the monitor virtual user. So for example in the GUI look in the script editor that is loaded for PostgreSQL and find the following timing section. In this example, it is modified to print out "running bespoke command after 2 mins" after 2 minutes. So you can put anything you want in here - to execute an external command use "exec", for SQL commands, see examples later in the driver script.