diff --git a/server/app/com/xsn/explorer/data/anorm/LedgerPostgresDataHandler.scala b/server/app/com/xsn/explorer/data/anorm/LedgerPostgresDataHandler.scala index c397513b..1a74f8a5 100644 --- a/server/app/com/xsn/explorer/data/anorm/LedgerPostgresDataHandler.scala +++ b/server/app/com/xsn/explorer/data/anorm/LedgerPostgresDataHandler.scala @@ -34,7 +34,6 @@ class LedgerPostgresDataHandler @Inject() ( block: Block, transactions: List[Transaction]): ApplicationResult[Unit] = { - val start = System.currentTimeMillis() val result = withTransaction { implicit conn => val result = for { _ <- upsertBlockCascade(block.copy(nextBlockhash = None), transactions) @@ -51,8 +50,6 @@ class LedgerPostgresDataHandler @Inject() ( case _ => e } - val took = System.currentTimeMillis() - start - logger.info(s"Pushing block = ${block.hash}, took $took ms") result.badMap { _.map(fromError) } } @@ -119,13 +116,7 @@ class LedgerPostgresDataHandler @Inject() ( } private def insertBalanceBatch(balanceList: Iterable[Balance])(implicit conn: Connection) = { - val start = System.currentTimeMillis() - val result = balanceList.map { b => balancePostgresDAO.upsert(b) } - - val took = System.currentTimeMillis() - start - logger.info(s"Inserting balance batch, size = ${balanceList.size}, took = $took ms") - - result + balanceList.map { b => balancePostgresDAO.upsert(b) } } private def spendMap(transactions: List[Transaction]): Map[Address, BigDecimal] = { @@ -151,7 +142,6 @@ class LedgerPostgresDataHandler @Inject() ( } private def balances(transactions: List[Transaction]) = { - val start = System.currentTimeMillis() val spentList = spendMap(transactions).map { case (address, spent) => Balance(address, spent = spent) } @@ -165,8 +155,6 @@ class LedgerPostgresDataHandler @Inject() ( .mapValues { _.reduce(mergeBalances) } .values - val took = System.currentTimeMillis() - start - logger.info(s"Computing balances for transaction batch, size = ${transactions.size}, took = $took ms") result } diff --git a/server/app/com/xsn/explorer/data/anorm/dao/TransactionInputPostgresDAO.scala b/server/app/com/xsn/explorer/data/anorm/dao/TransactionInputPostgresDAO.scala index 6aa28b6b..43eee5cb 100644 --- a/server/app/com/xsn/explorer/data/anorm/dao/TransactionInputPostgresDAO.scala +++ b/server/app/com/xsn/explorer/data/anorm/dao/TransactionInputPostgresDAO.scala @@ -19,8 +19,6 @@ class TransactionInputPostgresDAO { case Nil => Some(inputs) case _ => - - val start = System.currentTimeMillis() val params = inputs.map { case (txid, input) => List( 'txid -> txid.string: NamedParameter, @@ -43,10 +41,6 @@ class TransactionInputPostgresDAO { ) val success = batch.execute().forall(_ == 1) - - val took = System.currentTimeMillis() - start - logger.info(s"Inserting input batch, size = ${inputs.size}, took = $took ms") - if (success) { Some(inputs) } else { diff --git a/server/app/com/xsn/explorer/data/anorm/dao/TransactionOutputPostgresDAO.scala b/server/app/com/xsn/explorer/data/anorm/dao/TransactionOutputPostgresDAO.scala index d8a40f4a..de56773b 100644 --- a/server/app/com/xsn/explorer/data/anorm/dao/TransactionOutputPostgresDAO.scala +++ b/server/app/com/xsn/explorer/data/anorm/dao/TransactionOutputPostgresDAO.scala @@ -32,7 +32,6 @@ class TransactionOutputPostgresDAO { outputs match { case Nil => Some(outputs) case _ => - val start = System.currentTimeMillis() val params = outputs.map { output => List( 'txid -> output.txid.string: NamedParameter, @@ -56,9 +55,6 @@ class TransactionOutputPostgresDAO { ) val success = batch.execute().forall(_ == 1) - - val took = System.currentTimeMillis() - start - logger.info(s"Inserting output batch, size = ${outputs.size}, took = $took ms") if (success) { Some(outputs) } else { diff --git a/server/app/com/xsn/explorer/data/anorm/dao/TransactionPostgresDAO.scala b/server/app/com/xsn/explorer/data/anorm/dao/TransactionPostgresDAO.scala index cf843361..8da9604a 100644 --- a/server/app/com/xsn/explorer/data/anorm/dao/TransactionPostgresDAO.scala +++ b/server/app/com/xsn/explorer/data/anorm/dao/TransactionPostgresDAO.scala @@ -50,21 +50,13 @@ class TransactionPostgresDAO @Inject() ( } private def insertDetails(transactions: List[Transaction])(implicit conn: Connection): Unit = { - val start = System.currentTimeMillis() val detailsResult = transactions.map(addressTransactionDetailsDAO.batchInsertDetails) - val took = System.currentTimeMillis() - start - - logger.info(s"Inserting address details batch, size = ${transactions.size}, took = $took ms") assert(detailsResult.forall(_.isDefined), "Inserting address details batch failed") } private def spend(transactions: List[Transaction])(implicit conn: Connection): Unit = { - val start = System.currentTimeMillis() val spendResult = transactions.map { tx => transactionOutputDAO.batchSpend(tx.id, tx.inputs) } - val took = System.currentTimeMillis() - start - - logger.info(s"Spending transaction batch, size = ${transactions.size}, took = $took ms") assert(spendResult.forall(_.isDefined), "Spending inputs batch failed") } @@ -73,7 +65,6 @@ class TransactionPostgresDAO @Inject() ( transactions match { case Nil => Some(transactions) case _ => - val start = System.currentTimeMillis() val params = transactions.zipWithIndex.map { case (transaction, index) => List( 'txid -> transaction.id.string: NamedParameter, @@ -95,9 +86,6 @@ class TransactionPostgresDAO @Inject() ( ) val success = batch.execute().forall(_ == 1) - - val took = System.currentTimeMillis() - start - logger.info(s"Inserting transaction batch, size = ${transactions.size}, took = $took ms") if (success) { Some(transactions) } else { diff --git a/server/app/com/xsn/explorer/services/LedgerSynchronizerService.scala b/server/app/com/xsn/explorer/services/LedgerSynchronizerService.scala index d0eba3b0..019f431f 100644 --- a/server/app/com/xsn/explorer/services/LedgerSynchronizerService.scala +++ b/server/app/com/xsn/explorer/services/LedgerSynchronizerService.scala @@ -158,12 +158,9 @@ class LedgerSynchronizerService @Inject() ( } private def getRPCBlock(blockhash: Blockhash): FutureApplicationResult[(Block, List[Transaction])] = { - val start = System.currentTimeMillis() val result = for { block <- xsnService.getBlock(blockhash).toFutureOr transactions <- transactionRPCService.getTransactions(block.transactions).toFutureOr - took = System.currentTimeMillis() - start - _ = logger.info(s"Retrieving block = $blockhash, took $took ms") } yield (block, transactions) result.toFuture