def print_statistic(self):
now = time.time()
if now - self.checkpoint > self.statistic_interval:
count = self.count.value
self.count.value = 0
delta = now - self.checkpoint
self.checkpoint = now
if now - self.checkpoint > 3 * self.statistic_interval:
# ????, ???????, ??????????, ?????
log.info("inserted {} rows in the past {}s".format(count, round(delta, 3)))
else:
log.info(
"delta:{}s count:{} speed:{}/s qsize:{} qfull:{} P:{} Th:{}".format(
round(delta, 3), count, round(count / delta, 2),
self.queue.qsize(), self.queue.full(),
multiprocessing.current_process().name,
threading.current_thread().name,
))
评论列表
文章目录