TPC-Council / HammerDB

HammerDB Database Load Testing and Benchmarking Tool
http://www.hammerdb.com
GNU General Public License v3.0
589 stars 119 forks source link

Add giset command to set generic dictionary settings #646

Closed sm-shaw closed 10 months ago

sm-shaw commented 10 months ago

Add giset command to modify generic dictionary settings and print generic to print the current settings out. Modifications are persisted to the SQLite storage. Update has also been made to tclpy fork to keep commands in sync https://github.com/sm-shaw/libtclpy/commit/f53b1fcda14cc15707b100178006e512b1cff928 Examples of usage of both commands as shown.

hammerdb>giset commandline keepalive_margin 600
Changed commandline:keepalive_margin from 10 to 600 for generic
hammerdb>print generic
Generic Dictionary Settings
theme                {
 scaling        = auto
 scaletheme     = auto
 pixelsperpoint = auto
}
sqlitedb             {
 sqlitedb_dir = TMP
}
code_highlight       {
 highlight = true
}
benchmark            {
 rdbms        = Oracle
 bm           = TPC-C
 first_result = NOPM
}
virtual_user_options {
 virtual_users   = 1
 user_delay      = 500
 repeat_delay    = 500
 iterations      = 1
 show_output     = 1
 log_to_temp     = 0
 unique_log_name = 0
 no_log_buffer   = 0
 log_timestamps  = 0
}
autopilot            {
 apmode             = disabled
 autopilot_duration = 10
 autopilot_sequence = 1 2 4 8 12 16 20 24
}
mode                 {
 hostname = localhost
 id       = 0
}
transaction_counter  {
 tc_refresh_rate    = 10
 tc_log_to_temp     = 0
 tc_unique_log_name = 0
 tc_log_timestamps  = 0
 tc_graph_ribbon    = false
}
metrics              {
 agent_hostname = localhost
 agent_id       = 0
}
datageneration       {
 gen_count_ware = 1
 gen_scale_fact = 1
 gen_num_vu     = 1
}
commandline          {
 sqlite_db        = TMP
 keepalive_margin = 600
 jobsoutput       = JSON
 jobs_disable     = 0
}
webservice           {
 ws_port = 8080
}
timeprofile          {
 profiler           = xtprof
 xt_unique_log_name = 0
 xt_gather_timeout  = 10
 xt_job_storage     = 1
}
hdb_version          {
 version = v4.9
}
sm-shaw commented 10 months ago

Updated command so functionality also enabled in primary/replica mode with multiple CLI instances of HammerDB.

hammerdb>switchmode primary
Switch from Local
to Primary mode?
Enter yes or no: replied yes
Setting Primary Mode at id : 15564, hostname : CRANE
Primary Mode active at id : 15564, hostname : CRANE

hammerdb>Received a new replica connection from host 127.0.0.1
New replica joined : {15606 CRANE}

hammerdb>giset commandline keepalive_margin 900
Changed commandline:keepalive_margin from 600 to 900 for generic
---
hammerdb>switchmode replica 15564 crane
Switch from Local
to Replica mode?
Enter yes or no: replied yes
Setting Replica Mode at id : 15606, hostname : CRANE
Replica connecting to crane 15564 : Connection succeeded
Primary call back successful

hammerdb>Changed commandline:keepalive_margin from 600 to 900 for generic
abondvt89 commented 10 months ago

Merging after reviews and approval of the three members of the code maintenance team.