5. Configure Driver

Set the type of workload to run. A timed workload with suppressed output is strongly recommended as a test workload will print considerable output to the command prompt.

hammerdb>diset tpcc redis_driver timed
Clearing Script, reload script to activate new setting
Script cleared
Changed tpcc:reddriver from test to timed for Redis

Configure workload settings, in this example the rampup and duration times are set.

hammerdb>diset tpcc redis_rampup 1
Changed tpcc:redis_rampup from 2 to 1 for Redis

hammerdb>diset tpcc redis_duration 3
Changed tpcc:redis_duration from 5 to 3 for Redis

Confirm the settings with the print dict command.

hammerdb>print dict
Dictionary Settings for Redis
connection {
 redis_host      = 127.0.0.1
 redis_port      = 6379
 redis_namespace = 1
}
tpcc       {
 redis_count_ware       = 10
 redis_num_vu           = 4
 redis_total_iterations = 1000000
 redis_raiseerror       = false
 redis_keyandthink      = false
 redis_driver           = timed
 redis_rampup           = 1
 redis_duration         = 3
 redis_allwarehouse     = false
 redis_timeprofile      = false
}

When all the settings have been chosen load the driver script with the loadscript command.

hammerdb>loadscript
Script loaded, Type "print script" to view

The loaded script can be viewed with the print script command.

hammerdb>print script
#!/usr/local/bin/tclsh8.6
#THIS SCRIPT TO BE RUN WITH VIRTUAL USER OUTPUT ENABLED
#EDITABLE OPTIONS##################################################
set library redis ;# Redis Library
set total_iterations 1000000 ;# Number of transactions before logging off
set RAISEERROR "false" ;# Exit script on Redis error (true or false)
set KEYANDTHINK "false" ;# Time for user thinking and keying (true or false)
set rampup 1;  # Rampup time in minutes before first Transaction Count is taken
set duration 3;  # Duration in minutes before second Transaction Count is taken
set mode "Local" ;# HammerDB operational mode
set host "127.0.0.1" ;# Address of the server hosting Redis 
set port "6379" ;# Port of the Redis Server, defaults to 6379
set namespace "1" ;# Namespace containing the TPC Schema
#EDITABLE OPTIONS##################################################

...