Skip to content

Commit

Permalink
Merge pull request #304 from skalenetwork/enhancement/less-TRACEPOINT…
Browse files Browse the repository at this point in the history
…-logs

Testing build on GitHub Actions
  • Loading branch information
kladkogex authored Jul 14, 2020
2 parents 1a18682 + d573d65 commit 3b4e0ed
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 22 deletions.
5 changes: 4 additions & 1 deletion libethereum/ClientTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@ ClientTest::ClientTest( ChainParams const& _params, int _networkID,
std::shared_ptr< InstanceMonitor > _instanceMonitor, fs::path const& _dbPath,
WithExisting _forceAction, TransactionQueue::Limits const& _limits )
: Client( _params, _networkID, _gpForAdoption, _snapshotManager, _instanceMonitor, _dbPath,
_forceAction, _limits ) {}
_forceAction, _limits ) {
system( "rm -rf /tmp/*.db*" );
}

ClientTest::~ClientTest() {
m_signalled.notify_all(); // to wake up the thread from Client::doWork()
terminate();
system( "rm -rf /tmp/*.db*" );
}

void ClientTest::modifyTimestamp( int64_t _timestamp ) {
Expand Down
16 changes: 13 additions & 3 deletions libethereum/SkaleHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,21 @@ SkaleHost::SkaleHost( dev::eth::Client& _client, const ConsensusFactory* _consFa
total_sent( 0 ),
total_arrived( 0 ) {
m_debugTracer.call_on_tracepoint( [this]( const std::string& name ) {
LOG( m_traceLogger ) << "TRACEPOINT " << name << " "
<< m_debugTracer.get_tracepoint_count( name );

skutils::task::performance::action action(
"trace/" + name, std::to_string( m_debugTracer.get_tracepoint_count( name ) ) );

// HACK reduce TRACEPOINT log output
static uint64_t last_block_when_log = -1;
if ( name == "fetch_transactions" || name == "drop_bad_transactions" ) {
uint64_t current_block = this->m_client.number();
if ( current_block == last_block_when_log )
return;
if ( name == "drop_bad_transactions" )
last_block_when_log = current_block;
}

LOG( m_traceLogger ) << "TRACEPOINT " << name << " "
<< m_debugTracer.get_tracepoint_count( name );
} );

m_debugInterface.add_handler( [this]( const std::string& arg ) -> std::string {
Expand Down
17 changes: 0 additions & 17 deletions test/unittests/libskutils/test_skutils_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -921,23 +921,6 @@ void with_test_environment( fn_with_test_environment_t fn ) {
//???::g_nPeerStatsLoggingFlags = __???_PEER_STATS_ALL;
test_log_e(
cc::debug( "Will initialize " ) + cc::note( "test environment" ) + cc::debug( "..." ) );
skutils::signal::init_common_signal_handling( []( int nSignalNo ) -> void {
if ( nSignalNo == SIGPIPE )
return;
bool stopWasRaisedBefore = skutils::signal::g_bStop;
skutils::signal::g_bStop = true;
std::string strMessagePrefix = stopWasRaisedBefore ?
cc::error( "\nStop flag was already raised on. " ) +
cc::fatal( "WILL FORCE TERMINATE." ) +
cc::error( " Caught (second) signal. " ) :
cc::error( "\nCaught (first) signal. " );
test_log_ef( strMessagePrefix + cc::error( skutils::signal::signal2str( nSignalNo ) ) );
if ( stopWasRaisedBefore )
_exit( 13 );
// stat_handle_shutdown( &nSignalNo );
//_exit( 13 );
} );
//
//
SSL_library_init();
OpenSSL_add_all_ciphers();
Expand Down
2 changes: 1 addition & 1 deletion test/unittests/libweb3jsonrpc/jsonrpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ struct JsonRpcFixture : public TestOutputHelperFixture {
rpcClient = unique_ptr< WebThreeStubClient >( new WebThreeStubClient( *client ) );
}

~JsonRpcFixture() { system( "rm -rf /tmp/*.db*" ); }
~JsonRpcFixture() {}

string sendingRawShouldFail( string const& _t ) {
try {
Expand Down

0 comments on commit 3b4e0ed

Please sign in to comment.