|
@@ -264,6 +264,22 @@ void NetIO::ing_receive_msgbundle(tcp::socket* csocket, clientid_t c_simid)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+#ifdef TRACE_SOCKIO
|
|
|
+ struct timeval now;
|
|
|
+ gettimeofday(&now, NULL);
|
|
|
+ long elapsedus = (now.tv_sec - last_ing.tv_sec) * 1000000
|
|
|
+ + (now.tv_usec - last_ing.tv_usec);
|
|
|
+ if (num_ing > 0 && elapsedus > 500000) {
|
|
|
+ printf("%lu.%06lu: End ingestion of %lu messages\n",
|
|
|
+ last_ing.tv_sec, last_ing.tv_usec, num_ing);
|
|
|
+ num_ing = 0;
|
|
|
+ }
|
|
|
+ if (num_ing == 0) {
|
|
|
+ printf("%lu.%06lu: Begin ingestion\n", now.tv_sec,
|
|
|
+ now.tv_usec);
|
|
|
+ }
|
|
|
+#endif
|
|
|
+
|
|
|
bool ret;
|
|
|
//Ingest the message_bundle
|
|
|
if(conf.private_routing) {
|
|
@@ -273,6 +289,11 @@ void NetIO::ing_receive_msgbundle(tcp::socket* csocket, clientid_t c_simid)
|
|
|
}
|
|
|
free(msgbundle);
|
|
|
|
|
|
+#ifdef TRACE_SOCKIO
|
|
|
+ gettimeofday(&last_ing, NULL);
|
|
|
+ ++num_ing;
|
|
|
+#endif
|
|
|
+
|
|
|
// Continue to async receive client message bundles
|
|
|
if(ret) {
|
|
|
ing_receive_msgbundle(csocket, c_simid);
|
|
@@ -486,6 +507,11 @@ NetIO::NetIO(boost::asio::io_context &io_context, const Config &config)
|
|
|
nodeios.resize(num_nodes);
|
|
|
me = conf.my_node_num;
|
|
|
|
|
|
+#ifdef TRACE_SOCKIO
|
|
|
+ last_ing = {0, 0};
|
|
|
+ num_ing = 0;
|
|
|
+#endif
|
|
|
+
|
|
|
// Node number n will accept connections from nodes 0, ..., n-1 and
|
|
|
// make connections to nodes n+1, ..., num_nodes-1. This is all
|
|
|
// single threaded, but it doesn't deadlock because node 0 isn't
|