Skip to content

Commit

Permalink
chore(repair,gossip): clean up logging
Browse files Browse the repository at this point in the history
  • Loading branch information
lidatong committed Jul 11, 2024
1 parent 0ae28be commit c1e8bf6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/flamenco/gossip/fd_gossip.c
Original file line number Diff line number Diff line change
Expand Up @@ -1725,7 +1725,7 @@ fd_gossip_make_prune( fd_gossip_t * glob, fd_pending_event_arg_t * arg ) {

char keystr[ FD_BASE58_ENCODED_32_SZ ];
fd_base58_encode_32( peerval->id.uc, NULL, keystr );
FD_LOG_NOTICE(("sending prune request for %lu origins to %s", origins_cnt, keystr));
FD_LOG_DEBUG(("sending prune request for %lu origins to %s", origins_cnt, keystr));

/* Make a prune request */
fd_gossip_msg_t gmsg;
Expand Down Expand Up @@ -1773,11 +1773,11 @@ fd_gossip_log_stats( fd_gossip_t * glob, fd_pending_event_arg_t * arg ) {
if( glob->recv_pkt_cnt == 0 )
FD_LOG_WARNING(("received no gossip packets!!"));
else
FD_LOG_NOTICE(("received %lu packets", glob->recv_pkt_cnt));
FD_LOG_DEBUG(("received %lu packets", glob->recv_pkt_cnt));
glob->recv_pkt_cnt = 0;
FD_LOG_NOTICE(("received %lu dup values and %lu new", glob->recv_dup_cnt, glob->recv_nondup_cnt));
FD_LOG_DEBUG(("received %lu dup values and %lu new", glob->recv_dup_cnt, glob->recv_nondup_cnt));
glob->recv_dup_cnt = glob->recv_nondup_cnt = 0;
FD_LOG_NOTICE(("pushed %lu values and filtered %lu", glob->push_cnt, glob->not_push_cnt));
FD_LOG_DEBUG(("pushed %lu values and filtered %lu", glob->push_cnt, glob->not_push_cnt));
glob->push_cnt = glob->not_push_cnt = 0;

int need_inactive = (glob->inactives_cnt == 0);
Expand Down
10 changes: 5 additions & 5 deletions src/flamenco/repair/fd_repair.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ is_good_peer( fd_active_elem_t * val ) {
static void
fd_actives_shuffle( fd_repair_t * repair ) {
if( repair->stake_weights_cnt == 0 ) {
FD_LOG_WARNING(( "repair does not have stake weights yet, shuffling active set" ));
FD_LOG_NOTICE(( "repair does not have stake weights yet, shuffling active set" ));
}

FD_SCRATCH_SCOPE_BEGIN {
Expand Down Expand Up @@ -803,7 +803,7 @@ fd_actives_shuffle( fd_repair_t * repair ) {
}
repair->actives_sticky_cnt = tot_cnt;

FD_LOG_NOTICE(
FD_LOG_DEBUG(
( "selected %lu peers for repair (best was %lu, good was %lu, leftovers was %lu)",
tot_cnt,
best_cnt,
Expand Down Expand Up @@ -943,9 +943,9 @@ print_stats( fd_active_elem_t * val ) {
if( val->avg_reqs == 0 )
FD_LOG_DEBUG(( "repair peer %32J: no requests sent", id ));
else if( val->avg_reps == 0 )
FD_LOG_NOTICE(( "repair peer %32J: avg_requests=%lu, no responses received", id, val->avg_reqs ));
FD_LOG_DEBUG(( "repair peer %32J: avg_requests=%lu, no responses received", id, val->avg_reqs ));
else
FD_LOG_NOTICE(( "repair peer %32J: avg_requests=%lu, response_rate=%f, latency=%f",
FD_LOG_DEBUG(( "repair peer %32J: avg_requests=%lu, response_rate=%f, latency=%f",
id,
val->avg_reqs,
((double)val->avg_reps)/((double)val->avg_reqs),
Expand All @@ -961,7 +961,7 @@ fd_repair_print_all_stats( fd_repair_t * glob ) {
if( !val->sticky ) continue;
print_stats( val );
}
FD_LOG_NOTICE( ( "peer count: %lu", fd_active_table_key_cnt( glob->actives ) ) );
FD_LOG_DEBUG( ( "peer count: %lu", fd_active_table_key_cnt( glob->actives ) ) );
}

void fd_repair_add_sticky( fd_repair_t * glob, fd_pubkey_t const * id ) {
Expand Down

0 comments on commit c1e8bf6

Please sign in to comment.