-
Notifications
You must be signed in to change notification settings - Fork 21
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
Adding the keying/think time to each transaction. #7
Conversation
Summary: Added support for keying and think times for each transaction that can be controlled using a configuration parameter. Changed the default configuration values to support running the workload optimally according to the specs. Changed some part of the Load workload to strictly follow the standard. Reviewers: Neha, Karthik
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! First pass of comments.
@@ -196,6 +196,51 @@ synchronized public void setCurrStatement(Statement s) { | |||
this.currStatement = s; | |||
} | |||
|
|||
private long getKeyingTime(TransactionType type) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be good to add a comment on top of this (and the next) function with the TPCC spec and the relevant section that specifies these values.
Also, perhaps consider renaming this function with the units at the end, such as: getKeyingTimeMillis()
if it is in millis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
// Wait for the keying time which is a fixed number for every type of transaction. | ||
long keying_time_msecs = getKeyingTime(transactionTypes.getType(pieceOfWork.getType())); | ||
try { | ||
long start_sleep = System.nanoTime(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this variable and the following LOG.info to measure the sleep time? We should get rid of these I feel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did this for debugging.
WOuldn't be part of the final code.
// Sleep for the think time duration. | ||
long think_time_msecs = getThinkTime(transactionTypes.getType(pieceOfWork.getType())); | ||
try { | ||
long start_sleep = System.nanoTime(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debugging. Won't be in the final code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
private double scaleFactor = 1.0; | ||
private double selectivity = -1.0; | ||
private int terminals; | ||
private int loaderThreads = ThreadUtil.availableProcessors(); | ||
private int numTxnTypes; | ||
private TraceReader traceReader = null; | ||
private boolean useKeyingTime = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With these defaults, we'll use keying and think time for other workloads like workload_1
, workload_2
etc. also. Just want to make sure that it's intentional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workload_all should be what we should run now. And all of our defaults should be to make it run easy for that.
For the other workloads we can still make it false and then run it.
warehouse.w_state = TPCCUtil.randomStr(3).toUpperCase(); | ||
warehouse.w_zip = "123456789"; | ||
warehouse.w_state = TPCCUtil.randomStr(2).toUpperCase(); | ||
warehouse.w_zip = TPCCUtil.randomNStr(4) + "11111"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add this to the description as well - since your diff includes more than just the changes for think/keying time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment already had these details/. {point 3 in the message above}
Summary:
Added support for keying and think times for each transaction that can
be controlled using a configuration parameter.
Changed the default configuration values to support running the workload
optimally according to the specs.
Changed some part of the Load workload to strictly follow the standard.
Reviewers:
Neha, Karthik