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

Make jobs functionality modular #458

Merged
merged 6 commits into from
Nov 14, 2022

Conversation

sm-shaw
Copy link
Contributor

@sm-shaw sm-shaw commented Nov 10, 2022

This pull request brings all the job related code in different sections together into a single jobs module for future maintainability.

The pull request also:

  1. Enables the jobs output for the timing and tcount data that was missing from the previous update.
  2. Allows switching of jobs output between JSON and text.
  3. Adds an option to disable/enable the jobs output - by default it is enabled.
  4. Disables by default the jobs functionality in the GUI - this is disabled in lieu of adding a jobs interface to the GUI so will be enabled at a future release:

To enable for testing in the GUI in jobs module uncomment the following:

proc init_job_tables_gui { } {
#In the GUI, we disable the jobs output even though it works by running the jobs command in the console
 rename jobs {}
 uplevel #0 {proc hdbjobs { args } { return "" }}
#If we want to enable jobs output in the GUI comment out previous 2 lines and uncomment the following line
 #init_job_tables
}

To enable the time profiling in the GUI in the xtprof module update the following:

#If running in the GUI do not try to store output in SQLite
if { [ tsv::exists commandline sqldb ] eq 0 } {
set xtjob_storage 0
}

The following parameters are added:

<commandline>
 <sqlite_db>TMP</sqlite_db>
<jobsoutput>JSON</jobsoutput>
<jobs_disable>0</jobs_disable>
</commandline>
..
<timeprofile>
<xt_job_storage>1</xt_job_storage>
</timeprofile>

Example output with new functionality from this PR:

C:\HammerDB-storejob_update\Build\BawtBuild\vs2022\x64\Release\Distribution\HammerDB-4.6>hammerdbcli
HammerDB CLI v4.6
Copyright (C) 2003-2022 Steve Shaw
Type "help" for a list of commands
Initialized SQLite on-disk database C:/Users/smsha/AppData/Local/Temp/hammer.DB using existing tables (200,704 KB)
hammerdb>jobs
[
"636D0B27C5D803E273437363",
"636D0CB5B38B03E273230313",
"636D0D30FCB003E223135363",
"636D0DB94E0903E293936363",
"636D0E74BDC903E243734353",
"636D1008AE6003E283330303",
"636D16BE8F4C03E203031373",
"636D16D19A8C03E263730353",
"636D16EAA98F03E263332313",
"636D17A619A303E283232383",
"636D18E7D87903E213432393",
"636D1A188E7603E243736373",
"636D1B4E474E03E253034313",
"636D1E27F9C203E293337353",
"636D1EE36A0203E273134353"
]


hammerdb>
hammerdb>jobs 636D1EE36A0203E273134353 result
[
"636D1EE36A0203E273134353",
"2022-11-10 15:55:15",
"8 Active Virtual Users configured",
"TEST RESULT : System achieved 84767 NOPM from 197119 SQL Server TPM"
]

hammerdb>jobs 636D1EE36A0203E273134353 tcount
{"MSSQLServer tpm": {
"0": "2022-11-10 15:55:15",
"146574": "2022-11-10 15:55:25",
"209502": "2022-11-10 15:55:35",
"229542": "2022-11-10 15:55:46",
"219078": "2022-11-10 15:55:56",
"201930": "2022-11-10 15:56:06",
"217962": "2022-11-10 15:56:16",
"215688": "2022-11-10 15:56:26",
"221238": "2022-11-10 15:56:36",
"209952": "2022-11-10 15:56:46",
"212550": "2022-11-10 15:56:56",
"188166": "2022-11-10 15:57:06",
"217692": "2022-11-10 15:57:16",
"203022": "2022-11-10 15:57:26",
"183282": "2022-11-10 15:57:36",
"195666": "2022-11-10 15:57:46",
"192834": "2022-11-10 15:57:56",
"155154": "2022-11-10 15:58:06",
"166032": "2022-11-10 15:58:17"
}}

hammerdb>jobs 636D1EE36A0203E273134353 timing

{
"NEWORD": {
"elapsed_ms": "179676.0",
"calls": "31403",
"min_ms": "0.449",
"avg_ms": "2.209",
"max_ms": "3729.143",
"total_ms": "69365.185",
"p99_ms": "5.775",
"p95_ms": "3.406",
"p50_ms": "1.34",
"sd": "346672.597",
"ratio_pct": "39.122"
},
"PAYMENT": {
"elapsed_ms": "179676.0",
"calls": "31842",
"min_ms": "0.378",
"avg_ms": "1.451",
"max_ms": "522.647",
"total_ms": "46204.391",
"p99_ms": "4.416",
"p95_ms": "2.502",
"p50_ms": "1.033",
"sd": "69424.702",
"ratio_pct": "26.06"
},
"DELIVERY": {
"elapsed_ms": "179676.0",
"calls": "3189",
"min_ms": "0.932",
"avg_ms": "9.093",
"max_ms": "4893.757",
"total_ms": "28997.872",
"p99_ms": "9.199",
"p95_ms": "5.763",
"p50_ms": "2.303",
"sd": "1413264.621",
"ratio_pct": "16.355"
},
"SLEV": {
"elapsed_ms": "179676.0",
"calls": "3115",
"min_ms": "0.814",
"avg_ms": "6.239",
"max_ms": "4986.561",
"total_ms": "19435.007",
"p99_ms": "7.132",
"p95_ms": "4.017",
"p50_ms": "1.578",
"sd": "1153839.412",
"ratio_pct": "10.961"
},
"OSTAT": {
"elapsed_ms": "179676.0",
"calls": "3091",
"min_ms": "0.325",
"avg_ms": "2.518",
"max_ms": "2574.53",
"total_ms": "7781.634",
"p99_ms": "6.103",
"p95_ms": "3.684",
"p50_ms": "1.375",
"sd": "462932.604",
"ratio_pct": "4.389"
}
}

hammerdb>

src/generic/genvu.tcl Outdated Show resolved Hide resolved
@abondvt89
Copy link
Contributor

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

@abondvt89 abondvt89 merged commit 386d0a7 into TPC-Council:master Nov 14, 2022
@sm-shaw sm-shaw deleted the storejob_update branch November 23, 2022 11:20
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.

3 participants