def main(): config_ini = ConfigINI('etc/heap_comparison_benchmark.ini') old_versions = utils.load_run_config_ini(config_ini=config_ini, path=["OLD_VERSION", "Params"]) new_versions = utils.load_run_config_ini(config_ini=config_ini, path=["NEW_VERSION", "Params"]) all_versions = [] all_versions.extend(old_versions) all_versions.extend(new_versions) omim = Omim() try: # Run routes_builder_tool each route separately, save maximum memory usage for all versions. data_from_heap_comparison = run_heap_comparison(omim=omim, config_ini=config_ini, versions=all_versions) LOG.info("run_heap_comparison() Done.") utils.log_with_stars("Run run_results_comparison()") # Compare each version from |old_versions| to each version from |new_versions|, dump some useful info to log. # Like: maximum memory usage (mb), median, average, min etc. run_results_comparison( config_ini=config_ini, old_versions=old_versions, new_versions=new_versions, data_from_heap_comparison=data_from_heap_comparison) except Exception as e: LOG.error(f'Error in run_heap_comparison(): {e}') omim.checkout_to_init_state() sys.exit() omim.checkout_to_init_state()
def _notify(self, line: str, record: dict = None): """ Notify concerned entities that a record has been parsed :param line: original str :param record: newly parsed record :return: None """ try: if self.bom_event: self.bom_event(sender=self, line=line, record=record, state=self._state) except AttributeError as aerr: LOG.error('Invalid BOM Notification', str(aerr)) except BaseException as err: LOG.exception(err)
def main(): config_ini = ConfigINI('etc/comparison.ini') old_versions = utils.load_run_config_ini(config_ini=config_ini, path=["OLD_VERSION", "Params"]) new_versions = utils.load_run_config_ini(config_ini=config_ini, path=["NEW_VERSION", "Params"]) all_versions = [] all_versions.extend(old_versions) all_versions.extend(new_versions) omim = Omim() try: # Run sequentially all versions of routing and dumps results to some directory # based on ResultsSaveDir from config_ini file. data_from_routes_builder_tool = run_routes_builder_tool( omim=omim, config_ini=config_ini, versions=all_versions) except Exception as e: LOG.info(f'Error in run_routes_builder_tool(): {e}') omim.checkout_to_init_state() sys.exit() LOG.info("run_routes_builder_tool() Done.") omim.checkout(branch='master') omim.build(aim='routing_quality_tool') try: # Run routing_quality_tool, which compares results of routes_builder_tool. run_routing_quality_tool( omim=omim, config_ini=config_ini, old_versions=old_versions, new_versions=new_versions, data_from_routes_builder_tool=data_from_routes_builder_tool) except Exception as e: LOG.error(f'Error in run_routing_quality_tool(): {e}') omim.checkout_to_init_state() sys.exit() omim.checkout_to_init_state()