Commit dfe4f554 authored by Michael Whittaker's avatar Michael Whittaker

Disable recovery + small benchClient tweak.

parent 72ced4e0
......@@ -32,6 +32,7 @@ IRReplica::IRReplica(transport::Configuration config, int myIdx,
{
transport->Register(this, config, myIdx);
#if 0
// If our view info was previously initialized, then we are being started
// in recovery mode. If our view info has never been initialized, then this
// is the first time we are being run.
......@@ -59,6 +60,7 @@ IRReplica::IRReplica(transport::Configuration config, int myIdx,
new Timeout(transport, view_change_timeout_ms,
[this]() { this->HandleViewChangeTimeout(); }));
view_change_timeout->Start();
#endif
}
IRReplica::~IRReplica() { }
......@@ -423,19 +425,23 @@ void IRReplica::HandleViewChangeTimeout() {
}
void IRReplica::PersistViewInfo() {
#if 0
PersistedViewInfo view_info;
view_info.set_view(view);
view_info.set_latest_normal_view(latest_normal_view);
std::string output;
ASSERT(view_info.SerializeToString(&output));
persistent_view_info.Write(output);
#endif
}
void IRReplica::RecoverViewInfo() {
#if 0
PersistedViewInfo view_info;
view_info.ParseFromString(persistent_view_info.Read());
view = view_info.view();
latest_normal_view = view_info.latest_normal_view();
#endif
}
void IRReplica::BroadcastDoViewChangeMessages() {
......
......@@ -44,7 +44,7 @@ main(int argc, char **argv)
MODE_WEAK,
MODE_STRONG
} mode = MODE_UNKNOWN;
// Mode for strongstore.
strongstore::Mode strongmode;
......@@ -52,19 +52,19 @@ main(int argc, char **argv)
while ((opt = getopt(argc, argv, "c:d:N:l:w:k:f:m:e:s:z:r:")) != -1) {
switch (opt) {
case 'c': // Configuration path
{
{
configPath = optarg;
break;
}
case 'f': // Generated keys path
{
{
keysPath = optarg;
break;
}
case 'N': // Number of shards.
{
{
char *strtolPtr;
nShards = strtoul(optarg, &strtolPtr, 10);
if ((*optarg == '\0') || (*strtolPtr != '\0') ||
......@@ -75,7 +75,7 @@ main(int argc, char **argv)
}
case 'd': // Duration in seconds to run.
{
{
char *strtolPtr;
duration = strtoul(optarg, &strtolPtr, 10);
if ((*optarg == '\0') || (*strtolPtr != '\0') ||
......@@ -249,10 +249,10 @@ main(int argc, char **argv)
gettimeofday(&t4, NULL);
client->Begin();
gettimeofday(&t1, NULL);
beginCount++;
beginLatency += ((t1.tv_sec - t4.tv_sec)*1000000 + (t1.tv_usec - t4.tv_usec));
for (int j = 0; j < tLen; j++) {
key = keys[rand_key()];
......@@ -260,7 +260,7 @@ main(int argc, char **argv)
gettimeofday(&t3, NULL);
client->Put(key, key);
gettimeofday(&t4, NULL);
putCount++;
putLatency += ((t4.tv_sec - t3.tv_sec)*1000000 + (t4.tv_usec - t3.tv_usec));
} else {
......@@ -282,8 +282,8 @@ main(int argc, char **argv)
long latency = (t2.tv_sec - t1.tv_sec)*1000000 + (t2.tv_usec - t1.tv_usec);
fprintf(stderr, "%d %ld.%06ld %ld.%06ld %ld %d\n", nTransactions+1, t1.tv_sec,
t1.tv_usec, t2.tv_sec, t2.tv_usec, latency, status?1:0);
// fprintf(stderr, "%d %ld.%06ld %ld.%06ld %ld %d\n", nTransactions+1, t1.tv_sec,
// t1.tv_usec, t2.tv_sec, t2.tv_usec, latency, status?1:0);
if (status) {
tCount++;
......@@ -292,17 +292,31 @@ main(int argc, char **argv)
nTransactions++;
gettimeofday(&t1, NULL);
if ( ((t1.tv_sec-t0.tv_sec)*1000000 + (t1.tv_usec-t0.tv_usec)) > duration*1000000)
if ( ((t1.tv_sec-t0.tv_sec)*1000000 + (t1.tv_usec-t0.tv_usec)) > duration*1000000)
break;
}
fprintf(stderr, "# Commit_Ratio: %lf\n", (double)tCount/nTransactions);
fprintf(stderr, "# Overall_Latency: %lf\n", tLatency/tCount);
fprintf(stderr, "# Begin: %d, %lf\n", beginCount, beginLatency/beginCount);
fprintf(stderr, "# Get: %d, %lf\n", getCount, getLatency/getCount);
fprintf(stderr, "# Put: %d, %lf\n", putCount, putLatency/putCount);
fprintf(stderr, "# Commit: %d, %lf\n", commitCount, commitLatency/commitCount);
// fprintf(stderr, "# Commit_Ratio: %lf\n", (double)tCount/nTransactions);
// fprintf(stderr, "# Overall_Latency: %lf\n", tLatency/tCount);
// fprintf(stderr, "# Begin: %d, %lf\n", beginCount, beginLatency/beginCount);
// fprintf(stderr, "# Get: %d, %lf\n", getCount, getLatency/getCount);
// fprintf(stderr, "# Put: %d, %lf\n", putCount, putLatency/putCount);
// fprintf(stderr, "# Commit: %d, %lf\n", commitCount, commitLatency/commitCount);
gettimeofday(&t1, NULL);
long total_duration_micros = (t1.tv_sec-t0.tv_sec)*1000000 + (t1.tv_usec-t0.tv_usec);
fprintf(stderr, "%ld,", total_duration_micros); // total_duration_micros
fprintf(stderr, "%d,", nTransactions); // num_transactions
fprintf(stderr, "%d,", tCount); // num_committed_transactions
fprintf(stderr, "%lf,", (double) nTransactions / total_duration_micros * 1e6); // throughput_tps
fprintf(stderr, "%lf,", (double) tCount / nTransactions); // commit_ratio
fprintf(stderr, "%ld,", total_duration_micros / nTransactions); // average_latency_micros
fprintf(stderr, "%lf,", beginLatency / beginCount); // average_begin_latency_micros
fprintf(stderr, "%lf,", getLatency / getCount); // average_get_latency_micros
fprintf(stderr, "%lf,", putLatency / putCount); // average_put_latency_micros
fprintf(stderr, "%lf,", commitLatency / commitCount); // average_commit_latency_micros
fprintf(stderr, "\n");
return 0;
}
......@@ -348,5 +362,5 @@ int rand_key()
}
}
return mid;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment