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

Add CLI savescript and custommonitor commands #522

Merged
merged 3 commits into from
Mar 17, 2023

Conversation

sm-shaw
Copy link
Contributor

@sm-shaw sm-shaw commented Mar 7, 2023

Provides enhancement for Issue #521 adding CLI functionality to save and edit CLI scripts and to set the monitor virtual user before doing vucreate for such scripts.

savescript will add a .tcl extension if one is not already applied and either save to a fully qualified directory if given or to the temp area if not. Example of saving and loading.

hammerdb>savescript test
Success ... wrote script to /tmp/test.tcl

hammerdb>customscript /tmp/test.tcl
Loaded /tmp/test.tcl

custommonitor adds the additional monitor virtual user when doing a vucreate if the script is based on a timed script.

hammerdb>custommonitor timed
Monitor Virtual User enabled for customscript

hammerdb>vucreate
Vuser 1 created MONITOR - WAIT IDLE
Vuser 2 created - WAIT IDLE
2 Virtual Users Created with Monitor VU

Note a potential perceived issue is that doing just custommonitor test and then vucreate, appears to ignore the setting. This however is not the case as there is no script loaded when vucreate is executed, in this case vucreate will then load the script according to the dict settings and set the monitor v accordingly overridng the settings made by the custommonitor command. So custommonitor is for custom scripts only as the command name should imply.

hammerdb>custommonitor test
Monitor Virtual User disabled for custom script

hammerdb>vucreate
Script loaded, Type "print script" to view
Vuser 1 created MONITOR - WAIT IDLE
Vuser 2 created - WAIT IDLE
2 Virtual Users Created with Monitor VU

Built and tested also on Windows.

hammerdb>customscript C:/Users/smsha/AppData/Local/Temp/test.tcl
Loaded C:/Users/smsha/AppData/Local/Temp/test.tcl

hammerdb>custommonitor test
Monitor Virtual User disabled for custom script

hammerdb>vucreate
Vuser 1 created - WAIT IDLE
1 Virtual Users Created

hammerdb>vudestroy
vudestroy success

hammerdb>custommonitor timed
Monitor Virtual User enabled for customscript

hammerdb>vucreate
Vuser 1 created MONITOR - WAIT IDLE
Vuser 2 created - WAIT IDLE
2 Virtual Users Created with Monitor VU

hammerdb>vudestroy
vudestroy success

hammerdb>custommonitor test
Monitor Virtual User disabled for custom script

hammerdb>vucreate
Vuser 1 created - WAIT IDLE
1 Virtual Users Created

hammerdb>

Also the tclpy package has been updated to add the savescript and custommonitor commands to the python CLI interface here https://github.com/sm-shaw/libtclpy. This can be updated using build from source.

@sm-shaw sm-shaw requested a review from a team as a code owner March 7, 2023 14:10
@sm-shaw sm-shaw linked an issue Mar 7, 2023 that may be closed by this pull request
@abondvt89
Copy link
Contributor

Approving with two reviews until Code Maintenance Team expands back to three members

@abondvt89 abondvt89 merged commit 5add5cf into TPC-Council:master Mar 17, 2023
@sm-shaw sm-shaw deleted the 521 branch May 5, 2023 11:26
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.

Enhance CLI for editing and running custom scripts
2 participants