3014 Jonas Oreland 2008-10-20
ndb - add extra read argument to flexAsynch
modified:
storage/ndb/test/ndbapi/flexAsynch.cpp
=== modified file 'storage/ndb/test/ndbapi/flexAsynch.cpp'
--- a/storage/ndb/test/ndbapi/flexAsynch.cpp 2008-10-16 10:35:22 +0000
+++ b/storage/ndb/test/ndbapi/flexAsynch.cpp 2008-10-20 09:47:41 +0000
@@ -111,6 +111,7 @@ static unsigned int tNoOfOps
static unsigned int tLoadFactor = 80;
static bool tempTable = false;
static bool startTransGuess = true;
+static int tExtraReadLoop = 0;
//Program Flags
static int theTestFlag = 0;
@@ -337,11 +338,14 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "f
failed = 0 ;
- START_TIMER;
- execute(stRead);
- STOP_TIMER;
- a_r.addObservation((1000 * noOfTransacts * tNoOfOpsPerTrans) /
timer.elapsedTime());
- PRINT_TIMER("read", noOfTransacts, tNoOfOpsPerTrans);
+ for (int ll = 0; ll < 1 + tExtraReadLoop; ll++)
+ {
+ START_TIMER;
+ execute(stRead);
+ STOP_TIMER;
+ a_r.addObservation((1000 * noOfTransacts * tNoOfOpsPerTrans) /
timer.elapsedTime());
+ PRINT_TIMER("read", noOfTransacts, tNoOfOpsPerTrans);
+ }
if (0 < failed) {
int i = retry_opt ;
@@ -412,11 +416,14 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "f
failed = 0 ;
- START_TIMER;
- execute(stRead);
- STOP_TIMER;
- a_r.addObservation((1000 * noOfTransacts * tNoOfOpsPerTrans) /
timer.elapsedTime());
- PRINT_TIMER("read", noOfTransacts, tNoOfOpsPerTrans);
+ for (int ll = 0; ll < 1 + tExtraReadLoop; ll++)
+ {
+ START_TIMER;
+ execute(stRead);
+ STOP_TIMER;
+ a_r.addObservation((1000 * noOfTransacts * tNoOfOpsPerTrans) /
timer.elapsedTime());
+ PRINT_TIMER("read", noOfTransacts, tNoOfOpsPerTrans);
+ }
if (0 < failed) {
int i = retry_opt ;
@@ -1080,6 +1087,8 @@ readArguments(int argc, const char** arg
tNdbRecord = true;
argc++;
i--;
+ } else if (strcmp(argv[i], "-r") == 0){
+ tExtraReadLoop = atoi(argv[i+1]);
} else {
return -1;
}
| Thread |
|---|
| • bzr push into mysql-5.1 branch (jonas:3014) | Jonas Oreland | 20 Oct |