def log_network_result_stats(self, res, from_cache=False):
        # Increase stat counters
        self.stat.inc('spider:request-processed')
        self.stat.inc('spider:task')
        self.stat.inc('spider:task-%s' % res['task'].name)
        if (res['task'].network_try_count == 1 and
                res['task'].task_try_count == 1):
            self.stat.inc('spider:task-%s-initial' % res['task'].name)

        # Update traffic statistics
        if res['grab'] and res['grab'].response:
            resp = res['grab'].response
            self.timer.inc_timer('network-name-lookup', resp.name_lookup_time)
            self.timer.inc_timer('network-connect', resp.connect_time)
            self.timer.inc_timer('network-total', resp.total_time)
            if from_cache:
                self.stat.inc('spider:download-size-with-cache',
                              resp.download_size)
                self.stat.inc('spider:upload-size-with-cache',
                              resp.upload_size)
            else:
                self.stat.inc('spider:download-size', resp.download_size)
                self.stat.inc('spider:upload-size', resp.upload_size)
dataset/ETHPy150Open lorien/grab/grab/spider/base.py/Spider.log_network_result_stats/original