def save_stats(self): """Print timing information to infer_out/stats.json""" proc_stats_path = os.path.join(self.args.infer_out, utils.PROC_STATS_FILENAME) # capture and compile mode do not create proc_stats.json if os.path.isfile(proc_stats_path): with open(proc_stats_path, 'r') as proc_stats_file: proc_stats = json.load(proc_stats_file) self.stats['int'].update(proc_stats) self.stats['float'] = { 'capture_time': self.timing.get('capture', 0.0), 'makefile_generation_time': self.timing.get('makefile_generation', 0.0), 'analysis_time': self.timing.get('analysis', 0.0), 'reporting_time': self.timing.get('reporting', 0.0), } self.stats['normal'] = { 'analyzer': self.args.analyzer, 'infer_version': utils.infer_version() } stats_path = os.path.join(self.args.infer_out, utils.STATS_FILENAME) with open(stats_path, 'w') as stats_file: json.dump(self.stats, stats_file, indent=2)
def save_stats(self): """Print timing information to infer_out/stats.json""" proc_stats_path = os.path.join( self.args.infer_out, utils.PROC_STATS_FILENAME) # capture and compile mode do not create proc_stats.json if os.path.isfile(proc_stats_path): with open(proc_stats_path, 'r') as proc_stats_file: proc_stats = json.load(proc_stats_file) self.stats['int'].update(proc_stats) self.stats['float'] = { 'capture_time': self.timing.get('capture', 0.0), 'makefile_generation_time': self.timing.get( 'makefile_generation', 0.0), 'analysis_time': self.timing.get('analysis', 0.0), 'reporting_time': self.timing.get('reporting', 0.0), } self.stats['normal'] = { 'analyzer': self.args.analyzer, 'infer_version': utils.infer_version() } stats_path = os.path.join(self.args.infer_out, utils.STATS_FILENAME) with open(stats_path, 'w') as stats_file: json.dump(self.stats, stats_file, indent=2)
def save_stats(self): """Print timing information to infer_out/stats.json""" stats_path = os.path.join(self.args.infer_out, utils.STATS_FILENAME) self.stats['int'].update(self.javac_stats()) self.stats['float'].update({ 'capture_time': self.timing.get('capture', 0.0), 'analysis_time': self.timing.get('analysis', 0.0), 'reporting_time': self.timing.get('reporting', 0.0), }) # Adding the analyzer and the version of Infer self.stats['normal'] = {} self.stats['normal']['analyzer'] = self.args.analyzer self.stats['normal']['infer_version'] = utils.infer_version() with open(stats_path, 'w') as stats_file: json.dump(self.stats, stats_file, indent=2)
def save_stats(self): """Print timing information to infer_out/stats.json""" stats_path = os.path.join(self.args.infer_out, utils.STATS_FILENAME) with open(stats_path, 'r+') as stats_file: file_stats = json.load(stats_file) self.stats['int'].update(file_stats) self.stats['float'] = { 'capture_time': self.timing.get('capture', 0.0), 'analysis_time': self.timing.get('analysis', 0.0), 'reporting_time': self.timing.get('reporting', 0.0), } self.stats['normal'] = { 'analyzer': self.args.analyzer, 'infer_version': utils.infer_version() } stats_file.seek(0) json.dump(self.stats, stats_file, indent=2) stats_file.truncate()
def save_stats(self): """Print timing information to infer_out/stats.json""" stats_path = os.path.join(self.args.infer_out, utils.STATS_FILENAME) self.stats["int"].update(self.javac_stats()) self.stats["float"].update( { "capture_time": self.timing.get("capture", 0.0), "analysis_time": self.timing.get("analysis", 0.0), "reporting_time": self.timing.get("reporting", 0.0), } ) # Adding the analyzer and the version of Infer self.stats["normal"] = {} self.stats["normal"]["analyzer"] = self.args.analyzer self.stats["normal"]["infer_version"] = utils.infer_version() with open(stats_path, "w") as stats_file: json.dump(self.stats, stats_file, indent=2)
def save_stats(self): """Print timing information to infer_out/stats.json""" proc_stats_path = os.path.join(self.args.infer_out, utils.PROC_STATS_FILENAME) # capture and compile mode do not create proc_stats.json if os.path.isfile(proc_stats_path): with open(proc_stats_path, "r") as proc_stats_file: proc_stats = json.load(proc_stats_file) self.stats["int"].update(proc_stats) self.stats["float"] = { "capture_time": self.timing.get("capture", 0.0), "makefile_generation_time": self.timing.get("makefile_generation", 0.0), "analysis_time": self.timing.get("analysis", 0.0), "reporting_time": self.timing.get("reporting", 0.0), } self.stats["normal"] = {"analyzer": self.args.analyzer, "infer_version": utils.infer_version()} stats_path = os.path.join(self.args.infer_out, utils.STATS_FILENAME) with open(stats_path, "w") as stats_file: json.dump(self.stats, stats_file, indent=2)