From 22c46ebf9658da3dfff8c50e70b8f357a87e6d04 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Sun, 26 Jul 2020 08:37:32 -0700 Subject: [PATCH] Report block status more frequently --- ledger-tool/src/bigtable.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/ledger-tool/src/bigtable.rs b/ledger-tool/src/bigtable.rs index 6fea79155b..960ac24875 100644 --- a/ledger-tool/src/bigtable.rs +++ b/ledger-tool/src/bigtable.rs @@ -10,13 +10,7 @@ use solana_ledger::{blockstore::Blockstore, blockstore_db::AccessType}; use solana_measure::measure::Measure; use solana_sdk::{clock::Slot, pubkey::Pubkey, signature::Signature}; use solana_transaction_status::UiTransactionEncoding; -use std::{ - collections::HashSet, - path::Path, - process::exit, - result::Result, - time::{Duration, Instant}, -}; +use std::{collections::HashSet, path::Path, process::exit, result::Result, time::Duration}; use tokio::time::delay_for; // Attempt to upload this many blocks in parallel @@ -137,7 +131,6 @@ async fn upload( ( std::thread::spawn(move || { let mut measure = Measure::start("block loader thread"); - let mut last_status_update = Instant::now(); for (i, slot) in blocks_to_upload.iter().enumerate() { let _ = match blockstore.get_confirmed_block( *slot, @@ -153,14 +146,13 @@ async fn upload( } }; - if Instant::now().duration_since(last_status_update).as_secs() >= 60 { + if i % NUM_BLOCKS_TO_UPLOAD_IN_PARALLEL == 0 { info!( "{}% of blocks processed ({}/{})", i * 100 / blocks_to_upload.len(), i, blocks_to_upload.len() ); - last_status_update = Instant::now(); } } measure.stop();