0% found this document useful (0 votes)
379 views

Hammerdb Commandline

This document discusses extending HammerDB autopilot mode through the command line. It introduces new functionality added in version 2.17 that allows HammerDB to be started in autopilot mode by running "hammerdb.tcl auto [script name].tcl". This enables scripting of multiple autopilot test runs while modifying the configuration between runs. An example script is provided that runs different autopilot sequences with database refreshes in between through SSH. Support questions should be directed to the HammerDB Sourceforge forum.

Uploaded by

abc6309982
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
379 views

Hammerdb Commandline

This document discusses extending HammerDB autopilot mode through the command line. It introduces new functionality added in version 2.17 that allows HammerDB to be started in autopilot mode by running "hammerdb.tcl auto [script name].tcl". This enables scripting of multiple autopilot test runs while modifying the configuration between runs. An example script is provided that runs different autopilot sequences with database refreshes in between through SSH. Support questions should be directed to the HammerDB Sourceforge forum.

Uploaded by

abc6309982
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Extending HammerDB Autopilot at the Command Line

This guide gives you an introduction to extending HammerDB autopilot mode with the command line a
feature introduced at HammerDB version 2.17. You should be familiar with running tests manually and
using Autopilot before using this functionality.

Using the Command Line ................................................................................................................ 1


HammerDB CLI ............................................................................................................................. 1
Support and Questions ..................................................................................................................... 2

Using the Command Line

The solution contributed by Wes Vaske here has been fully implemented into HammerDB (with
modifications) at version 2.17 and therefore requires no additional code enhancements to run HammerDB
from CLI within a Windows or Linux environment. Although HammerDB still requires a graphical display to
run this functionality enables the user to interact with an external environment and script multiple test runs
whilst modifying the configuration.

HammerDB CLI
HammerDB can continue to be started in an interactive mode as previously by running hammerdb.tcl on
Linux and hammerdb.bat on Windows, however new functionality has been added on both Linux and
Windows to accept the keyword auto followed by the name of a script to run, this script must end in the
extension .tcl.
./hammerdb.tcl auto
Usage: hammerdb.tcl [ auto [ script_to_autoload.tcl ] ]

For example
./hammerdb.tcl auto newtpccscript.tcl

On doing so HammerDB will now load the script newtpccscript.tcl at startup and immediately enter the
autopilot sequence defined in config.xml. Upon completion HammerDB will exit. As detailed in the post
linked above this functionality enables the potential to run workloads such as the following with multiple
sequences of autopilot interspersed with a database refresh.
#!/bin/bash

set -e
SEQ1="4 6 8 10"
SEQ2="12 14 16 18"
SEQ3="20 22 24 26"
CONFIGFILE='/usr/local/hammerDB/config.xml'
RUNS=6

for x in $(eval echo "{1..$RUNS}")


1
do
# Running a number of passes for this autopilot sequence
echo "running run $x of $RUNS"

for s in "$SEQ1" "$SEQ2" "$SEQ3"


do
echo "Running tests for series: $s"
sed -i
"s/<autopilot_sequence>.*<\/autopilot_sequence>/<autopilot_sequence>${s}
<\/autopilot_sequence>/" $CONFIGFILE

(cd /usr/local/hammerDB/ && ./hammerdb.tcl auto


TPCC.postgres.tcl)

echo "Reloading data"


ssh postgres@postgres '/var/lib/pgsql/reloadData.sh'
done
done

This solution coupled with autopilot enables considerable flexibility in defining and executing automated
database test workloads.

Support and Questions


For help use the HammerDB Sourceforge forum available at the HammerDB sourceforge project.

You might also like