Skip to content

Commit

Permalink
Trivial: add debug of apply block time
Browse files Browse the repository at this point in the history
  • Loading branch information
orogvany committed Feb 23, 2019
1 parent 8cc839f commit d5323aa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/org/semux/consensus/SemuxBft.java
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,9 @@ protected List<Transaction> getUnvalidatedTransactions(List<Transaction> transac
* @param block
*/
protected void applyBlock(Block block) {

long t1 = TimeUtil.currentTimeMillis();

BlockHeader header = block.getHeader();
List<Transaction> transactions = block.getTransactions();
long number = header.getNumber();
Expand Down Expand Up @@ -984,6 +987,10 @@ protected void applyBlock(Block block) {
} finally {
lock.unlock();
}

long t2 = TimeUtil.currentTimeMillis();
logger.debug("Block apply: # txs = {}, time = {} ms", transactions.size(), t2 - t1);

}

public enum State {
Expand Down

0 comments on commit d5323aa

Please sign in to comment.