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

Deprecate Web Service functionality, include features in GUI & CLI #420

Closed
sm-shaw opened this issue Aug 18, 2022 · 1 comment · Fixed by #453
Closed

Deprecate Web Service functionality, include features in GUI & CLI #420

sm-shaw opened this issue Aug 18, 2022 · 1 comment · Fixed by #453

Comments

@sm-shaw
Copy link
Contributor

sm-shaw commented Aug 18, 2022

This issue is a placeholder for the discussion/intention to remove the Web Service functionality/hammerdbws command and include some of the existing functionality in the CLI (and GUI).

The webservice was developed and introduced by request, however Bug #414 indicates that the webservice is not used as much as the GUI & CLI, and time might be better spent deprecating this feature and including the features in the other interfaces.

In particular, useful features to keep would be:

  1. An option for the CLI output to be in either text format (as current CLI) or JSON (as WS).
  2. Optional results repository as requested in Adding the enhancement for storing and retrieval of HammerDB results and configurations #352 - this would add the current ws jobs command to the CLI and if enabled cause the job output to be stored in the jobs database for querying at later points in time. This functionality also stores the dict for the job that was run, transaction count, timing etc so you can see the configuration for the job that was run, the output, results etc all grouped with an individual job id.

If adopted the CLI would be able to offer some of the current WS features, however the main feature that would be removed is the HTTP listener and being able to connect, run commands and query with a rest style interface. Instead, the interaction will be either with text commands in the CLI or with the GUI.

As an example of the current functionality, the following is a CLI script

script mdb.tcl

dbset db maria
diset tpcc maria_rampup 1
diset tpcc maria_duration 2
vuset vu vcpu
vurun

and an example of running this in the WS with the JSON output is shown as follows:
(The CLI would continue to print output to the console as well as store it in the repository database).

/opt/HammerDB-4.5-387$ ./hammerdbws 
HammerDB Web Service v4.5
Copyright (C) 2003-2022 Steve Shaw
Type "help" for a list of commands
Initialized SQLite on-disk database /tmp/hammer.DB using existing tables
Starting HammerDB Web Service on port 8080
Listening for HTTP requests on TCP port 8080
hammerws>dbset db maria
{"success": {"message": "Database set to MariaDB"}}

hammerws>dbset bm TPC-C
{"success": {"message": "Benchmark set to TPC-C for MariaDB"}}

hammerws>print dict
{
  "connection": {
    "maria_host": "127.0.0.1",
    "maria_port": "3306",
    "maria_socket": "\/tmp\/mariadb.sock",
    "maria_ssl": "false",
    "maria_ssl_two_way": "false",
    "maria_ssl_linux_capath": "\/etc\/mysql\/certs",
    "maria_ssl_windows_capath": "C:\\mysql\\certs",
    "maria_ssl_ca": "ca-cert.pem",
    "maria_ssl_cert": "client-cert.pem",
    "maria_ssl_key": "client-key.pem",
    "maria_ssl_cipher": "server"
  },
  "tpcc": {
    "maria_count_ware": "1",
    "maria_num_vu": "1",
    "maria_user": "root",
    "maria_pass": "maria",
    "maria_dbase": "tpcc",
    "maria_storage_engine": "innodb",
    "maria_partition": "false",
    "maria_prepared": "false",
    "maria_total_iterations": "10000000",
    "maria_raiseerror": "false",
    "maria_keyandthink": "false",
    "maria_driver": "timed",
    "maria_rampup": "2",
    "maria_duration": "5",
    "maria_allwarehouse": "false",
    "maria_timeprofile": "false",
    "maria_async_scale": "false",
    "maria_async_client": "10",
    "maria_async_verbose": "false",
    "maria_async_delay": "1000",
    "maria_connect_pool": "false"
  }
}

hammerws>source mdb.tcl
{"success": {"message": "Database set to MariaDB"}}
{"success": {"message": "Changed tpcc:maria_rampup from 2 to 1 for MariaDB"}}
{"success": {"message": "Changed tpcc:maria_duration from 5 to 2 for MariaDB"}}
{"success": {"message": "Virtual users set to vcpu"}}
{"success": {"message": "script loaded"}}{"success": {"message": "Running Virtual Users: JOBID=62FE4E735E6803E203438353"}}
{"success": {"message": "Timer: 1 minutes elapsed"}}
{"success": {"message": "Timer: 2 minutes elapsed"}}
{"success": {"message": "runtimer returned after 179 seconds"}}
62FE4E735E6803E203438353
hammerws>jobs
["62FE4E735E6803E203438353"]
hammerws>jobs 62FE4E735E6803E203438353 result
[
  "62FE4E735E6803E203438353",
  "2022-08-18 15:36:35",
  "4 Active Virtual Users configured",
  "TEST RESULT : System achieved 33221 NOPM from 77601 MariaDB TPM"
]

What would be removed would be the ability to run commands and query over HTTP as follows:

ws

Doing this would make the 2 available interfaces more streamlined. The opportunity is there for anyone to raise the request to keep the WS functionality and continue to maintain it, as new functionality has been added up to PR #415

@sm-shaw
Copy link
Contributor Author

sm-shaw commented Nov 4, 2022

Pull Request # 453 adds queryable repository storage for job information, ported from web service to CLI & GUI

hammerdb>jobs
6364F17F5ECA03E243835303
6364F3765ECA03E273434313
6364F7385ECA03E293734363
hammerdb>job 6364F17F5ECA03E243835303 status
Virtual User 0: Ready to create a 20 Warehouse MariaDB TPROC-C schema
in host LOCALHOST:/TMP/MARIADB.SOCK under user ROOT in database TPCC with storage engine INNODB?
Virtual User 0: Logging activated
to /tmp/hammerdb.log
Virtual User 0: Vuser 1:RUNNING
Virtual User 0: Vuser 2:RUNNING
Virtual User 0: Vuser 3:RUNNING
Virtual User 0: Vuser 4:RUNNING
Virtual User 0: Vuser 5:RUNNING
Virtual User 0: Vuser 6:RUNNING
Virtual User 0: Vuser 4:FINISHED SUCCESS
Virtual User 0: Vuser 3:FINISHED SUCCESS
Virtual User 0: Vuser 2:FINISHED SUCCESS
Virtual User 0: Vuser 5:FINISHED SUCCESS
Virtual User 0: Vuser 6:FINISHED SUCCESS
Virtual User 0: Vuser 1:FINISHED SUCCESS
Virtual User 0: ALL VIRTUAL USERS COMPLETE

hammerdb>job 6364F17F5ECA03E243835303 timestamp
6364F17F5ECA03E243835303 {2022-11-04 11:03:27}
hammerdb>job 6364F3765ECA03E273434313 result
6364F3765ECA03E273434313
2022-11-04 11:11:50
2 Active Virtual Users configured
TEST RESULT : System achieved 26201 NOPM from 60673 MariaDB TPM
hammerdb>set myjob [vurun]
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
Vuser 1:RUNNING
Vuser 1:Ssl_cipher 
Vuser 1:Beginning rampup time of 1 minutes
Vuser 2:RUNNING
Vuser 2:Ssl_cipher 
Vuser 2:Processing 10000000 transactions with output suppressed...
Vuser 1:Rampup 1 minutes complete ...
Vuser 1:Rampup complete, Taking start Transaction Count.
Vuser 1:Timing test period of 1 in minutes
Vuser 1:1 ...,
Vuser 1:Test complete, Taking end Transaction Count.
Vuser 1:1 Active Virtual Users configured
Vuser 1:TEST RESULT : System achieved 15445 NOPM from 36131 MariaDB TPM
Vuser 1:FINISHED SUCCESS
Vuser 2:FINISHED SUCCESS
ALL VIRTUAL USERS COMPLETE
jobid=636513C45ECA03E203236363
hammerdb>puts $myjob
jobid=636513C45ECA03E203236363

Output can be set as text or JSON

<commandline>
        <keepalive_margin>10</keepalive_margin>
        <jobsoutput>text</jobsoutput>
    </commandline>

with JSON output as follows:

hammerdb>job 636501DA5ECA03E233932313 result
[
  "636501DA5ECA03E233932313",
  "2022-11-04 12:13:14",
  "1 Active Virtual Users configured",
  "TEST RESULT : System achieved 15682 NOPM from 36624 MariaDB TPM"
]

Functionality to query jobs will initially be in the CLI, however jobs will be created for the GUI as well.
The ability to browse jobs will be added to the GUI at a future release.

sm-shaw added a commit that referenced this issue Nov 5, 2022
* Store Job Info to SQLite

* Update gencli.tcl

* return jobid from vurun

* Add text to jobid return value

* Fix duplicated dialog open error messages

Co-authored-by: Hua Jiang <ricky_jiang_h@hotmail.com>
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 a pull request may close this issue.

1 participant