Client Logging of TCL Script Output Used for Tests #555
-
My ultimate goal is to view the SQL statements that are executed on the SUT, but I don't want to use HammerDB stat viewer (or whatever it's called). My understanding is that HammerDB randomly generates those statements. Is it possible to log the result of that random generation on the client? HammerDB with GUI isn't a reasonable tool for my use, so I'm limited to CLI. I also don't want to spend a bunch of time manually inspecting the SQL statements on the DB. To me, a simple alternative is to log the statements at generation. Open to any feedback on this. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Really basic and easy to do: e.g. server side - use simple commands provided by your database for example MariaDB
client side modify the driver script to print the exec statements for the database you are using e.g. again for MariaDB
For a beginner it is much easier to use the GUI to modify your script, save it and then load it into the CLI with customscript.
Note although it may be obvious, HammerDB is fully multi-threaded - once you start writing lots of output it becomes single threaded as you only have 1 console to write to - so messages are passed to the master thread for writing. This is why the timed scripts do not print output but the test ones do. |
Beta Was this translation helpful? Give feedback.
-
Fortunately with PostgreSQL you have pg_stat_statements 'The pg_stat_statements module provides a means for tracking planning and execution statistics of all SQL statements executed by a server'.
Then you can use SQL statements to query all of the SQL in your database over time. Although you said you didn't want to use the GUI, the GUI takes exactly the approach you describe. Once enabled, hit the metrics button and then drag out the window and expand it. An example is shown below. So drag the grey box in the AAS window to the time you are interested in and you can see the SQL running at that time. You can also see the associated SQL statistics by clicking on the right tabs. Note that the example above is when functions are selected. When stored procedures are selected, you instead see the calls to the stored procedures as shown. This matches up to the "puts" statement if you modify the script. Otherwise you will need to query pg_stat_statements manually. |
Beta Was this translation helpful? Give feedback.
Really basic and easy to do:
e.g. server side - use simple commands provided by your database for example MariaDB