Skip to content

Commit

Permalink
Print ETA when loading and compressing NEAR Lake data
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrichina committed Jan 18, 2024
1 parent c4ea8c4 commit 7c75eff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/load-raw-near-lake.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,10 @@ async function sync(bucketName, startAfter, limit = 1000) {
}

blocksProcessed += blocks.length;
console.log(blockHeight, `Speed: ${blocksProcessed / ((Date.now() - timeStarted) / 1000)} blocks/s`);
const timeElapsed = Date.now() - timeStarted;
const speed = blocksProcessed / (timeElapsed / 1000);
const eta = Math.round((limit - blocksProcessed) / speed);
console.log(blockHeight, `Speed: ${speed} blocks/s`, `ETA: ${eta}s`);
});
writeQueue.push(task);
}
Expand Down

0 comments on commit 7c75eff

Please sign in to comment.