connector

This commit is contained in:
4tochka 2019-06-03 10:16:18 +04:00
parent 4807096349
commit 935bba0944
2 changed files with 7 additions and 4 deletions

View File

@ -463,13 +463,16 @@ class Connector:
self.utxo.saved_utxo, self.utxo.saved_utxo,
self.utxo.deleted_utxo, self.utxo.deleted_utxo,
self.utxo.loaded_utxo)) self.utxo.loaded_utxo))
if self.utxo.read_from_db_time_total:
c = round(self.utxo.read_from_db_count / self.utxo.read_from_db_time_total, 4)
else:
c = 0
self.log.debug(" Read from db last batch %s; " self.log.debug(" Read from db last batch %s; "
"count %s; " "count %s; "
"rate %s; " "rate %s; "
"total time %s; " % (round(self.utxo.read_from_db_time, 4), "total time %s; " % (round(self.utxo.read_from_db_time, 4),
self.utxo.read_from_db_count, self.utxo.read_from_db_count,
round(self.utxo.read_from_db_count c,
/self.utxo.read_from_db_time_total, 4),
int(self.utxo.read_from_db_time_total))) int(self.utxo.read_from_db_time_total)))
self.utxo.read_from_db_time = 0 self.utxo.read_from_db_time = 0
self.utxo.read_from_db_count = 0 self.utxo.read_from_db_count = 0

View File

@ -45,7 +45,7 @@ class UTXO():
self.deleted_utxo = 0 self.deleted_utxo = 0
self.read_from_db_time = 0 self.read_from_db_time = 0
self.read_from_db_count = 0 self.read_from_db_count = 0
self.read_from_db_time_total = 1 self.read_from_db_time_total = 0
self.loaded_utxo = 0 self.loaded_utxo = 0
self.destroyed_utxo = 0 self.destroyed_utxo = 0
self.destroyed_utxo_block = 0 self.destroyed_utxo_block = 0