(self, rcpts, subject)
send notification mail with some additional useful info
send notification mail with some additional useful info
send notification mail with some additional useful info
def _send_report(self, rcpts, subject):
        """send notification mail with some additional useful info"""
        stats = self.crawler.stats
        s = f"Memory usage at engine startup : {stats.get_value('memusage/startup')/1024/1024}M\r\n"
        s += f"Maximum memory usage          : {stats.get_value('memusage/max')/1024/1024}M\r\n"
        s += f"Current memory usage          : {self.get_virtual_size()/1024/1024}M\r\n"

        s += "ENGINE STATUS ------------------------------------------------------- \r\n"
        s += "\r\n"
        s += pformat(get_engine_status(self.crawler.engine))
        s += "\r\n"
        self.mail.send(rcpts, subject, s)
def _send_report ( self , rcpts , subject ) : stats = self . crawler . stats s = f"Memory usage at engine startup : {stats.get_value('memusage/startup')/1024/1024}M\r\n" s += f"Maximum memory usage          : {stats.get_value('memusage/max')/1024/1024}M\r\n" s += f"Current memory usage          : {self.get_virtual_size()/1024/1024}M\r\n" s += "ENGINE STATUS ------------------------------------------------------- \r\n" s += "\r\n" s += pformat ( get_engine_status ( self . crawler . engine ) ) s += "\r\n" self . mail . send ( rcpts , subject , s )