Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persist VU settings across restarts #696

Merged

Conversation

v1k1nghawk
Copy link
Contributor

@v1k1nghawk v1k1nghawk commented Apr 23, 2024

Automatically update the VU generic settings inside the vuset command (CLI) and inside the Virtual User Options (GUI) to make it easier to persist VU settings across restarts. Write the values to SQLite storage when set or the user presses OK.

Example of the new vuset (CLI) behavior across the restarts:

$ ./hammerdbcli
HammerDB CLI v4.10
Copyright (C) 2003-2024 Steve Shaw
Type "help" for a list of commands
Initialized Jobs on-disk database /tmp/hammer.DB using existing tables (335,872 KB)
hammerdb>vurun
Script loaded, Type "print script" to view
Vuser 1 created MONITOR - WAIT IDLE
Vuser 2 created - WAIT IDLE
Vuser 3 created - WAIT IDLE
Vuser 4 created - WAIT IDLE
Vuser 5 created - WAIT IDLE
5 Virtual Users Created with Monitor VU
...
hammerdb>print generic
Generic Dictionary Settings
...
virtual_user_options {
 virtual_users   = 4
 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
}
...
hammerdb>vudestroy
vudestroy success

hammerdb>vuset vu 7

hammerdb>vucreate
Vuser 1 created MONITOR - WAIT IDLE
Vuser 2 created - WAIT IDLE
Vuser 3 created - WAIT IDLE
Vuser 4 created - WAIT IDLE
Vuser 5 created - WAIT IDLE
Vuser 6 created - WAIT IDLE
Vuser 7 created - WAIT IDLE
Vuser 8 created - WAIT IDLE
8 Virtual Users Created with Monitor VU

hammerdb>exit
$ ./hammerdbcli
HammerDB CLI v4.10
Copyright (C) 2003-2024 Steve Shaw
Type "help" for a list of commands
Initialized Jobs on-disk database /tmp/hammer.DB using existing tables (335,872 KB)
hammerdb>vurun
Script loaded, Type "print script" to view
Vuser 1 created MONITOR - WAIT IDLE
Vuser 2 created - WAIT IDLE
Vuser 3 created - WAIT IDLE
Vuser 4 created - WAIT IDLE
Vuser 5 created - WAIT IDLE
Vuser 6 created - WAIT IDLE
Vuser 7 created - WAIT IDLE
Vuser 8 created - WAIT IDLE
8 Virtual Users Created with Monitor VU
...
hammerdb>print generic
Generic Dictionary Settings
...
virtual_user_options {
 virtual_users   = 7
 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
}
...

Virtual Users Options menu (GUI) is the same before and after the restart:
image

@v1k1nghawk v1k1nghawk requested a review from a team as a code owner April 23, 2024 10:53
@v1k1nghawk v1k1nghawk marked this pull request as draft April 24, 2024 09:01
@sm-shaw
Copy link
Contributor

sm-shaw commented Apr 24, 2024

Many thanks for the pull request, I will take a look and review as soon as time allows.

@sm-shaw
Copy link
Contributor

sm-shaw commented Apr 29, 2024

I've done a quick overview and some changes are needed, for the GUI it makes more sense to update the entire dict rather than every value with a single command and for the cli the command updates the SQLite data to persist over restarts but does not update the dict so if you do print generic after doing vuset it still shows the old value. I will do a commit to the PR that corrects these and then it should be good.

Copy link
Contributor

@sm-shaw sm-shaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per comment added change 5ff2f8a to update GUI persistence with a single command and to persist CLI changes also in the current genericdict

@abondvt89 abondvt89 merged commit 81c82df into TPC-Council:master Apr 30, 2024
@v1k1nghawk v1k1nghawk deleted the persist_VU_settings_across_restarts branch May 1, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add CLI & GUI functionality to persist VU settings automatically across restarts
4 participants