コード例 #1
0
ファイル: devtools_browser.py プロジェクト: mshemp/wptagent
 def process_devtools_requests(self, task):
     """Process the devtools log and pull out the requests information"""
     path_base = os.path.join(self.task['dir'], self.task['prefix'])
     devtools_file = path_base + '_devtools.json.gz'
     if os.path.isfile(devtools_file):
         from internal.support.devtools_parser import DevToolsParser
         out_file = path_base + '_devtools_requests.json.gz'
         options = {'devtools': devtools_file, 'cached': task['cached'], 'out': out_file}
         netlog = path_base + '_netlog_requests.json.gz'
         options['netlog'] = netlog if os.path.isfile(netlog) else None
         optimization = path_base + '_optimization.json.gz'
         options['optimization'] = optimization if os.path.isfile(optimization) else None
         user_timing = path_base + '_user_timing.json.gz'
         options['user'] = user_timing if os.path.isfile(user_timing) else None
         coverage = path_base + '_coverage.json.gz'
         options['coverage'] = coverage if os.path.isfile(coverage) else None
         cpu = path_base + '_timeline_cpu.json.gz'
         options['cpu'] = cpu if os.path.isfile(cpu) else None
         v8stats = path_base + '_v8stats.json.gz'
         options['v8stats'] = v8stats if os.path.isfile(v8stats) else None
         parser = DevToolsParser(options)
         parser.process()
         # Cleanup intermediate files that are not needed
         if 'debug' not in self.job or not self.job['debug']:
             if os.path.isfile(netlog):
                 os.remove(netlog)
             if os.path.isfile(optimization):
                 os.remove(optimization)
             if os.path.isfile(coverage):
                 os.remove(coverage)
             if os.path.isfile(devtools_file):
                 os.remove(devtools_file)
         if 'page_data' in parser.result and 'result' in parser.result['page_data']:
             self.task['page_result'] = parser.result['page_data']['result']
コード例 #2
0
 def process_devtools_requests(self, task):
     """Process the devtools log and pull out the requests information"""
     path_base = os.path.join(self.task['dir'], self.task['prefix'])
     devtools_file = path_base + '_devtools.json.gz'
     if os.path.isfile(devtools_file):
         from internal.support.devtools_parser import DevToolsParser
         out_file = path_base + '_devtools_requests.json.gz'
         options = {
             'devtools': devtools_file,
             'cached': task['cached'],
             'out': out_file
         }
         netlog = path_base + '_netlog_requests.json.gz'
         options['netlog'] = netlog if os.path.isfile(netlog) else None
         optimization = path_base + '_optimization.json.gz'
         options['optimization'] = optimization if os.path.isfile(
             optimization) else None
         parser = DevToolsParser(options)
         parser.process()