Skip to content

Commit

Permalink
#1774 remove debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
olehnikolaiev committed Mar 11, 2024
1 parent be40594 commit 8cb0fa2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 47 deletions.
24 changes: 0 additions & 24 deletions libethereum/SkaleHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -866,37 +866,13 @@ void SkaleHost::broadcastFunc() {
size_t nBroadcastTaskNumber = 0;
while ( !m_exitNeeded ) {
try {
static uint64_t txnsCounterSnd = 0;
static boost::chrono::milliseconds totalExecutionTimeSnd =
boost::chrono::milliseconds( 0 );
m_broadcaster->broadcast( "" ); // HACK this is just to initialize sockets

boost::chrono::high_resolution_clock::time_point txnProccessingTimeStart =
boost::chrono::high_resolution_clock::now();

dev::eth::Transactions txns = m_tq.topTransactionsSync( 1, 0, 1 );

boost::chrono::high_resolution_clock::time_point txnProccessingTimeFinish =
boost::chrono::high_resolution_clock::now();
if ( txns.empty() ) // means timeout
continue;

totalExecutionTimeSnd += boost::chrono::duration_cast< boost::chrono::milliseconds >(
txnProccessingTimeFinish - txnProccessingTimeStart );
++txnsCounterSnd;
auto t = boost::chrono::duration_cast< boost::chrono::milliseconds >(
txnProccessingTimeFinish - txnProccessingTimeStart )
.count();
if ( t > 1000 ) {
clog( dev::VerbosityWarning, "skale-host" )
<< "Took " << t << " ms to get txn from TQ before broadcast";
}
if ( txnsCounterSnd % 1000 == 0 ) {
auto avrgTST = totalExecutionTimeSnd / txnsCounterSnd;
clog( dev::VerbosityWarning, "skale-host" )
<< "Average time to prepare txn for broadcast is " << avrgTST << " ms";
}

this->logState();

MICROPROFILE_SCOPEI( "SkaleHost", "broadcastFunc", MP_BISQUE );
Expand Down
23 changes: 0 additions & 23 deletions libskale/broadcaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,6 @@ void ZmqBroadcaster::startService() {
zmq_msg_t msg;

try {
static uint64_t txnsCounterRcv = 0;
static boost::chrono::milliseconds totalExecutionTimeRcv =
boost::chrono::milliseconds( 0 );
boost::chrono::high_resolution_clock::time_point txnProccessingTimeStart =
boost::chrono::high_resolution_clock::now();
int res = zmq_msg_init( &msg );
assert( res == 0 );
res = zmq_msg_recv( &msg, client_socket(), 0 );
Expand Down Expand Up @@ -211,24 +206,6 @@ void ZmqBroadcaster::startService() {

try {
m_skaleHost.receiveTransaction( str );
boost::chrono::high_resolution_clock::time_point txnProccessingTimeFinish =
boost::chrono::high_resolution_clock::now();
totalExecutionTimeRcv +=
boost::chrono::duration_cast< boost::chrono::milliseconds >(
txnProccessingTimeFinish - txnProccessingTimeStart );
++txnsCounterRcv;
auto t = boost::chrono::duration_cast< boost::chrono::milliseconds >(
txnProccessingTimeFinish - txnProccessingTimeStart )
.count();
if ( t > 1000 ) {
clog( dev::VerbosityWarning, "skale-host" )
<< "Took " << t << " ms to receive txn via broadcast";
}
if ( txnsCounterRcv % 1000 == 0 ) {
auto avrgTRT = totalExecutionTimeRcv / txnsCounterRcv;
clog( dev::VerbosityWarning, "skale-host" )
<< "Average txn receiving time via broadcast is " << avrgTRT << " ms";
}
} catch ( const std::exception& ex ) {
clog( dev::VerbosityDebug, "skale-host" )
<< "Received bad transaction through broadcast: " << ex.what();
Expand Down

0 comments on commit 8cb0fa2

Please sign in to comment.