|
@@ -112,7 +112,7 @@ void make_epoch(
|
|
|
|
|
|
std::unique_lock<std::mutex> updateLock(updateMtx, std::defer_lock);
|
|
|
|
|
|
- std::vector<size_t> bandwidthDataBefore = get_log_data(civetServer.getContext());
|
|
|
+ std::vector<size_t> bandwidthDataBefore = get_server_log_data(civetServer.getContext());
|
|
|
std::chrono::high_resolution_clock::time_point wallTimeBefore = std::chrono::high_resolution_clock::now();
|
|
|
clock_t cpuTimeBefore = clock();
|
|
|
|
|
@@ -141,7 +141,7 @@ void make_epoch(
|
|
|
|
|
|
clock_t cpuTimeAfter = clock();
|
|
|
std::chrono::high_resolution_clock::time_point wallTimeAfter = std::chrono::high_resolution_clock::now();
|
|
|
- std::vector<size_t> bandwidthDataAfter = get_log_data(civetServer.getContext());
|
|
|
+ std::vector<size_t> bandwidthDataAfter = get_server_log_data(civetServer.getContext());
|
|
|
|
|
|
std::vector<double> timingData(2);
|
|
|
timingData[0] = std::chrono::duration_cast<std::chrono::duration<double>>(wallTimeAfter - wallTimeBefore).count();
|
|
@@ -198,7 +198,7 @@ void obtain_update_locks(
|
|
|
std::cerr << "Couldn't connect to server " << i << " to obtain its lock" << std::endl;
|
|
|
}
|
|
|
|
|
|
- std::vector<size_t> bandwidthDataBefore = get_log_data(mg_get_context(conn));
|
|
|
+ std::vector<size_t> bandwidthDataBefore = get_conn_log_data(mg_get_context(conn), true);
|
|
|
|
|
|
// Ask for its lock
|
|
|
mg_websocket_client_write(conn, MG_WEBSOCKET_OPCODE_DATACOMPLETE, "", 0);
|
|
@@ -207,7 +207,7 @@ void obtain_update_locks(
|
|
|
while (!sync.val2)
|
|
|
sync.cv.wait(lck);
|
|
|
|
|
|
- std::vector<size_t> bandwidthDataAfter = get_log_data(mg_get_context(conn));
|
|
|
+ std::vector<size_t> bandwidthDataAfter = get_conn_log_data(mg_get_context(conn), true);
|
|
|
|
|
|
bandwidthData[0] += bandwidthDataAfter[0] - bandwidthDataBefore[0];
|
|
|
bandwidthData[1] += bandwidthDataAfter[1] - bandwidthDataBefore[1];
|
|
@@ -256,7 +256,7 @@ void release_update_locks(
|
|
|
std::cerr << "Couldn't connect to server " << i << " to release its lock" << std::endl;
|
|
|
}
|
|
|
|
|
|
- std::vector<size_t> bandwidthDataBefore = get_log_data(mg_get_context(conn));
|
|
|
+ std::vector<size_t> bandwidthDataBefore = get_conn_log_data(mg_get_context(conn), true);
|
|
|
|
|
|
// Return its lock
|
|
|
mg_websocket_client_write(conn, MG_WEBSOCKET_OPCODE_DATACOMPLETE, "", 0);
|
|
@@ -265,7 +265,7 @@ void release_update_locks(
|
|
|
while (!sync.val2)
|
|
|
sync.cv.wait(lck);
|
|
|
|
|
|
- std::vector<size_t> bandwidthDataAfter = get_log_data(mg_get_context(conn));
|
|
|
+ std::vector<size_t> bandwidthDataAfter = get_conn_log_data(mg_get_context(conn), true);
|
|
|
|
|
|
bandwidthData[0] += bandwidthDataAfter[0] - bandwidthDataBefore[0];
|
|
|
bandwidthData[1] += bandwidthDataAfter[1] - bandwidthDataBefore[1];
|
|
@@ -508,7 +508,7 @@ std::vector<Proof> epoch_build_up(
|
|
|
std::vector<size_t> bandwidthData(2);
|
|
|
std::vector<std::vector<size_t>> otherBandwidthDataBefore;
|
|
|
|
|
|
- std::vector<size_t> serverBandwidthDataBefore = get_log_data(civetServer.getContext());
|
|
|
+ std::vector<size_t> serverBandwidthDataBefore = get_server_log_data(civetServer.getContext());
|
|
|
std::chrono::high_resolution_clock::time_point wallTimeBefore = std::chrono::high_resolution_clock::now();
|
|
|
clock_t cpuTimeBefore = clock();
|
|
|
|
|
@@ -537,7 +537,7 @@ std::vector<Proof> epoch_build_up(
|
|
|
// Send that data
|
|
|
struct mg_connection *currConn = distribute_epoch_updates(serverIPs[j], serverPorts[j], data, &sync);
|
|
|
|
|
|
- otherBandwidthDataBefore.push_back(get_log_data(mg_get_context(currConn)));
|
|
|
+ otherBandwidthDataBefore.push_back(get_conn_log_data(mg_get_context(currConn), false));
|
|
|
|
|
|
// But keep track of that connection, as we can't close it until we know the server's gotten its data
|
|
|
conns.push_back(currConn);
|
|
@@ -549,7 +549,7 @@ std::vector<Proof> epoch_build_up(
|
|
|
|
|
|
for (size_t j = 0; j < conns.size(); j++)
|
|
|
{
|
|
|
- std::vector<size_t> currBandwidthDataAfter = get_log_data(mg_get_context(conns[j]));
|
|
|
+ std::vector<size_t> currBandwidthDataAfter = get_conn_log_data(mg_get_context(conns[j]), false);
|
|
|
|
|
|
bandwidthData[0] += currBandwidthDataAfter[0] - otherBandwidthDataBefore[j][0];
|
|
|
bandwidthData[1] += currBandwidthDataAfter[1] - otherBandwidthDataBefore[j][1];
|
|
@@ -561,7 +561,7 @@ std::vector<Proof> epoch_build_up(
|
|
|
|
|
|
clock_t cpuTimeAfter = clock();
|
|
|
std::chrono::high_resolution_clock::time_point wallTimeAfter = std::chrono::high_resolution_clock::now();
|
|
|
- std::vector<size_t> serverBandwidthDataAfter = get_log_data(civetServer.getContext());
|
|
|
+ std::vector<size_t> serverBandwidthDataAfter = get_server_log_data(civetServer.getContext());
|
|
|
|
|
|
std::vector<double> timingData(2);
|
|
|
timingData[0] = std::chrono::duration_cast<std::chrono::duration<double>>(wallTimeAfter - wallTimeBefore).count();
|
|
@@ -633,7 +633,7 @@ void epoch_break_down(
|
|
|
std::vector<size_t> bandwidthData(2);
|
|
|
std::vector<std::vector<size_t>> otherBandwidthDataBefore;
|
|
|
|
|
|
- std::vector<size_t> serverBandwidthDataBefore = get_log_data(civetServer.getContext());
|
|
|
+ std::vector<size_t> serverBandwidthDataBefore = get_server_log_data(civetServer.getContext());
|
|
|
std::chrono::high_resolution_clock::time_point wallTimeBefore = std::chrono::high_resolution_clock::now();
|
|
|
clock_t cpuTimeBefore = clock();
|
|
|
|
|
@@ -658,7 +658,7 @@ void epoch_break_down(
|
|
|
// Send that data
|
|
|
struct mg_connection *currConn = distribute_epoch_updates(serverIPs[j], serverPorts[j], data, &sync);
|
|
|
|
|
|
- otherBandwidthDataBefore.push_back(get_log_data(mg_get_context(currConn)));
|
|
|
+ otherBandwidthDataBefore.push_back(get_conn_log_data(mg_get_context(currConn), false));
|
|
|
|
|
|
// But keep track of that connection, as we can't close it until we know the server's gotten its data
|
|
|
conns.push_back(currConn);
|
|
@@ -670,7 +670,7 @@ void epoch_break_down(
|
|
|
|
|
|
for (size_t j = 0; j < conns.size(); j++)
|
|
|
{
|
|
|
- std::vector<size_t> currBandwidthDataAfter = get_log_data(mg_get_context(conns[j]));
|
|
|
+ std::vector<size_t> currBandwidthDataAfter = get_conn_log_data(mg_get_context(conns[j]), false);
|
|
|
|
|
|
bandwidthData[0] += currBandwidthDataAfter[0] - otherBandwidthDataBefore[j][0];
|
|
|
bandwidthData[1] += currBandwidthDataAfter[1] - otherBandwidthDataBefore[j][1];
|
|
@@ -682,7 +682,7 @@ void epoch_break_down(
|
|
|
|
|
|
clock_t cpuTimeAfter = clock();
|
|
|
std::chrono::high_resolution_clock::time_point wallTimeAfter = std::chrono::high_resolution_clock::now();
|
|
|
- std::vector<size_t> serverBandwidthDataAfter = get_log_data(civetServer.getContext());
|
|
|
+ std::vector<size_t> serverBandwidthDataAfter = get_server_log_data(civetServer.getContext());
|
|
|
|
|
|
std::vector<double> timingData(2);
|
|
|
timingData[0] = std::chrono::duration_cast<std::chrono::duration<double>>(wallTimeAfter - wallTimeBefore).count();
|
|
@@ -834,7 +834,7 @@ void tally_scores(
|
|
|
std::cerr << "Trouble getting partial decryption from server at " << serverIPs[i] << ":" << serverPorts[i] << std::endl;
|
|
|
}
|
|
|
|
|
|
- allBandwidthDataBefore.push_back(get_log_data(mg_get_context(currConn)));
|
|
|
+ allBandwidthDataBefore.push_back(get_conn_log_data(mg_get_context(currConn), true));
|
|
|
|
|
|
// Ping server for simulated distributed BGN
|
|
|
mg_websocket_client_write(currConn, MG_WEBSOCKET_OPCODE_DATACOMPLETE, "", 0);
|
|
@@ -849,7 +849,7 @@ void tally_scores(
|
|
|
// Close connections
|
|
|
for (size_t i = 0; i < conns.size(); i++)
|
|
|
{
|
|
|
- std::vector<size_t> currBandwidthDataAfter = get_log_data(mg_get_context(conns[i]));
|
|
|
+ std::vector<size_t> currBandwidthDataAfter = get_conn_log_data(mg_get_context(conns[i]), true);
|
|
|
|
|
|
bandwidthData[0] += currBandwidthDataAfter[0] - allBandwidthDataBefore[i][0];
|
|
|
bandwidthData[1] += currBandwidthDataAfter[1] - allBandwidthDataBefore[i][1];
|
|
@@ -937,7 +937,7 @@ void distribute_tallied_scores(
|
|
|
std::cerr << "Trouble giving full re-encryption to server at " << serverIPs[i] << ":" << serverPorts[i] << std::endl;
|
|
|
}
|
|
|
|
|
|
- allBandwidthDataBefore.push_back(get_log_data(mg_get_context(currConn)));
|
|
|
+ allBandwidthDataBefore.push_back(get_conn_log_data(mg_get_context(currConn), false));
|
|
|
|
|
|
// Send the relevant data
|
|
|
mg_websocket_client_write(currConn, MG_WEBSOCKET_OPCODE_BINARY, data.c_str(), data.length());
|
|
@@ -953,7 +953,7 @@ void distribute_tallied_scores(
|
|
|
// Close connections
|
|
|
for (size_t i = 0; i < conns.size(); i++)
|
|
|
{
|
|
|
- std::vector<size_t> currBandwidthDataAfter = get_log_data(mg_get_context(conns[i]));
|
|
|
+ std::vector<size_t> currBandwidthDataAfter = get_conn_log_data(mg_get_context(conns[i]), false);
|
|
|
|
|
|
bandwidthData[0] += currBandwidthDataAfter[0] - allBandwidthDataBefore[i][0];
|
|
|
bandwidthData[1] += currBandwidthDataAfter[1] - allBandwidthDataBefore[i][1];
|
|
@@ -2200,7 +2200,7 @@ void PrsonaServerWebSocketHandler::receive_vote(
|
|
|
|
|
|
std::vector<size_t> bandwidthData(2);
|
|
|
|
|
|
- std::vector<size_t> bandwidthDataBefore = get_log_data(civetServer->getContext());
|
|
|
+ std::vector<size_t> bandwidthDataBefore = get_server_log_data(civetServer->getContext());
|
|
|
std::chrono::high_resolution_clock::time_point wallTimeBefore = std::chrono::high_resolution_clock::now();
|
|
|
clock_t cpuTimeBefore = clock();
|
|
|
|
|
@@ -2221,7 +2221,7 @@ void PrsonaServerWebSocketHandler::receive_vote(
|
|
|
|
|
|
clock_t cpuTimeAfter = clock();
|
|
|
std::chrono::high_resolution_clock::time_point wallTimeAfter = std::chrono::high_resolution_clock::now();
|
|
|
- std::vector<size_t> bandwidthDataAfter = get_log_data(civetServer->getContext());
|
|
|
+ std::vector<size_t> bandwidthDataAfter = get_server_log_data(civetServer->getContext());
|
|
|
|
|
|
std::vector<double> timingData(2);
|
|
|
timingData[0] = std::chrono::duration_cast<std::chrono::duration<double>>(wallTimeAfter - wallTimeBefore).count();
|
|
@@ -2375,7 +2375,7 @@ void PrsonaServerWebSocketHandler::distribute_new_vote(
|
|
|
std::cerr << "Couldn't give server " << i << " new vote data" << std::endl;
|
|
|
}
|
|
|
|
|
|
- std::vector<size_t> bandwidthDataBefore = get_log_data(mg_get_context(conn));
|
|
|
+ std::vector<size_t> bandwidthDataBefore = get_conn_log_data(mg_get_context(conn), false);
|
|
|
|
|
|
// Send the server the new vote data
|
|
|
mg_websocket_client_write(conn, MG_WEBSOCKET_OPCODE_BINARY, data.c_str(), data.length());
|
|
@@ -2385,7 +2385,7 @@ void PrsonaServerWebSocketHandler::distribute_new_vote(
|
|
|
while (!sync.val2)
|
|
|
sync.cv.wait(syncLock);
|
|
|
|
|
|
- std::vector<size_t> bandwidthDataAfter = get_log_data(mg_get_context(conn));
|
|
|
+ std::vector<size_t> bandwidthDataAfter = get_conn_log_data(mg_get_context(conn), false);
|
|
|
|
|
|
bandwidthData[0] += bandwidthDataAfter[0] - bandwidthDataBefore[0];
|
|
|
bandwidthData[1] += bandwidthDataAfter[1] - bandwidthDataBefore[1];
|
|
@@ -2575,7 +2575,7 @@ void PrsonaServerWebSocketHandler::build_up_midway_pseudonyms(
|
|
|
std::vector<size_t> bandwidthData(2);
|
|
|
std::vector<std::vector<size_t>> otherBandwidthDataBefore;
|
|
|
|
|
|
- std::vector<size_t> serverBandwidthDataBefore = get_log_data(civetServer->getContext());
|
|
|
+ std::vector<size_t> serverBandwidthDataBefore = get_server_log_data(civetServer->getContext());
|
|
|
std::chrono::high_resolution_clock::time_point wallTimeBefore = std::chrono::high_resolution_clock::now();
|
|
|
clock_t cpuTimeBefore = clock();
|
|
|
|
|
@@ -2602,7 +2602,7 @@ void PrsonaServerWebSocketHandler::build_up_midway_pseudonyms(
|
|
|
struct mg_connection *currConn = distribute_epoch_updates(serverIPs[i], serverPorts[i], data, &sync);
|
|
|
|
|
|
conns.push_back(currConn);
|
|
|
- otherBandwidthDataBefore.push_back(get_log_data(mg_get_context(currConn)));
|
|
|
+ otherBandwidthDataBefore.push_back(get_conn_log_data(mg_get_context(currConn), false));
|
|
|
}
|
|
|
|
|
|
// Wait for all to acknowledge receipt of the update data
|
|
@@ -2612,7 +2612,7 @@ void PrsonaServerWebSocketHandler::build_up_midway_pseudonyms(
|
|
|
// Close connections
|
|
|
for (size_t i = 0; i < conns.size(); i++)
|
|
|
{
|
|
|
- std::vector<size_t> currBandwidthDataAfter = get_log_data(mg_get_context(conns[i]));
|
|
|
+ std::vector<size_t> currBandwidthDataAfter = get_conn_log_data(mg_get_context(conns[i]), false);
|
|
|
|
|
|
bandwidthData[0] += currBandwidthDataAfter[0] - otherBandwidthDataBefore[i][0];
|
|
|
bandwidthData[1] += currBandwidthDataAfter[1] - otherBandwidthDataBefore[i][1];
|
|
@@ -2622,7 +2622,7 @@ void PrsonaServerWebSocketHandler::build_up_midway_pseudonyms(
|
|
|
|
|
|
clock_t cpuTimeAfter = clock();
|
|
|
std::chrono::high_resolution_clock::time_point wallTimeAfter = std::chrono::high_resolution_clock::now();
|
|
|
- std::vector<size_t> serverBandwidthDataAfter = get_log_data(civetServer->getContext());
|
|
|
+ std::vector<size_t> serverBandwidthDataAfter = get_server_log_data(civetServer->getContext());
|
|
|
|
|
|
std::vector<double> timingData(2);
|
|
|
timingData[0] = std::chrono::duration_cast<std::chrono::duration<double>>(wallTimeAfter - wallTimeBefore).count();
|
|
@@ -2665,7 +2665,7 @@ void PrsonaServerWebSocketHandler::break_down_midway_pseudonyms(
|
|
|
std::vector<size_t> bandwidthData(2);
|
|
|
std::vector<std::vector<size_t>> otherBandwidthDataBefore;
|
|
|
|
|
|
- std::vector<size_t> serverBandwidthDataBefore = get_log_data(civetServer->getContext());
|
|
|
+ std::vector<size_t> serverBandwidthDataBefore = get_server_log_data(civetServer->getContext());
|
|
|
std::chrono::high_resolution_clock::time_point wallTimeBefore = std::chrono::high_resolution_clock::now();
|
|
|
clock_t cpuTimeBefore = clock();
|
|
|
|
|
@@ -2690,7 +2690,7 @@ void PrsonaServerWebSocketHandler::break_down_midway_pseudonyms(
|
|
|
struct mg_connection *currConn = distribute_epoch_updates(serverIPs[i], serverPorts[i], data, &sync);
|
|
|
|
|
|
conns.push_back(currConn);
|
|
|
- otherBandwidthDataBefore.push_back(get_log_data(mg_get_context(currConn)));
|
|
|
+ otherBandwidthDataBefore.push_back(get_conn_log_data(mg_get_context(currConn), false));
|
|
|
}
|
|
|
|
|
|
// Wait for all to acknowledge receipt of the update data
|
|
@@ -2700,7 +2700,7 @@ void PrsonaServerWebSocketHandler::break_down_midway_pseudonyms(
|
|
|
// Close connections
|
|
|
for (size_t i = 0; i < conns.size(); i++)
|
|
|
{
|
|
|
- std::vector<size_t> currBandwidthDataAfter = get_log_data(mg_get_context(conns[i]));
|
|
|
+ std::vector<size_t> currBandwidthDataAfter = get_conn_log_data(mg_get_context(conns[i]), false);
|
|
|
|
|
|
bandwidthData[0] += currBandwidthDataAfter[0] - otherBandwidthDataBefore[i][0];
|
|
|
bandwidthData[1] += currBandwidthDataAfter[1] - otherBandwidthDataBefore[i][1];
|
|
@@ -2710,7 +2710,7 @@ void PrsonaServerWebSocketHandler::break_down_midway_pseudonyms(
|
|
|
|
|
|
clock_t cpuTimeAfter = clock();
|
|
|
std::chrono::high_resolution_clock::time_point wallTimeAfter = std::chrono::high_resolution_clock::now();
|
|
|
- std::vector<size_t> serverBandwidthDataAfter = get_log_data(civetServer->getContext());
|
|
|
+ std::vector<size_t> serverBandwidthDataAfter = get_server_log_data(civetServer->getContext());
|
|
|
|
|
|
std::vector<double> timingData(2);
|
|
|
timingData[0] = std::chrono::duration_cast<std::chrono::duration<double>>(wallTimeAfter - wallTimeBefore).count();
|
|
@@ -2749,7 +2749,7 @@ void PrsonaServerWebSocketHandler::accept_epoch_updates(
|
|
|
// Un-serialize request
|
|
|
ssize_t bandwidthRcv = read_epoch_update_string(filename, pi, permutationCommits, freshPseudonymCommits, freshPseudonymSeedCommits, serverTallyCommits, partwayVoteMatrixCommits, finalVoteMatrixCommits, userTallyMaskCommits, userTallyMessageCommits, userTallySeedCommits, nextGenerator, doUserTallies);
|
|
|
|
|
|
- std::vector<size_t> bandwidthDataBefore = get_log_data(civetServer->getContext());
|
|
|
+ std::vector<size_t> bandwidthDataBefore = get_server_log_data(civetServer->getContext());
|
|
|
std::chrono::high_resolution_clock::time_point wallTimeBefore = std::chrono::high_resolution_clock::now();
|
|
|
clock_t cpuTimeBefore = clock();
|
|
|
|
|
@@ -2758,7 +2758,7 @@ void PrsonaServerWebSocketHandler::accept_epoch_updates(
|
|
|
|
|
|
clock_t cpuTimeAfter = clock();
|
|
|
std::chrono::high_resolution_clock::time_point wallTimeAfter = std::chrono::high_resolution_clock::now();
|
|
|
- std::vector<size_t> bandwidthDataAfter = get_log_data(civetServer->getContext());
|
|
|
+ std::vector<size_t> bandwidthDataAfter = get_server_log_data(civetServer->getContext());
|
|
|
|
|
|
std::vector<double> timingData(2);
|
|
|
timingData[0] = std::chrono::duration_cast<std::chrono::duration<double>>(wallTimeAfter - wallTimeBefore).count();
|