예제 #1
0
def run_interactive_mode():
    es.init_connection()

    if settings.config.getboolean("general", "es_wipe_all_existing_outliers"):
        es.remove_all_outliers()

    # Make sure housekeeping is up and running
    housekeeping_job = HousekeepingJob()
    housekeeping_job.start()

    try:
        analyzed_models = perform_analysis()
        print_analysis_summary(analyzed_models)
    except KeyboardInterrupt:
        logging.logger.info(
            "keyboard interrupt received, stopping housekeeping thread")
    except Exception:
        logging.logger.error("error running outliers in interactive mode",
                             exc_info=True)
    finally:
        logging.logger.info(
            "asking housekeeping jobs to shutdown after finishing")
        housekeeping_job.shutdown_flag.set()
        housekeeping_job.join()

    logging.logger.info("finished performing outlier detection")
예제 #2
0
            logging.logger.info(
                "no errors encountered while analyzing use cases")

        logging.print_generic_intro("finished performing outlier detection")

if settings.args.run_mode == "interactive":
    es.init_connection()

    if settings.config.getboolean("general", "es_wipe_all_existing_outliers"):
        es.remove_all_outliers()

    logging.logger.info(settings.get_time_window_info())

    housekeeping_job = HousekeepingJob()
    housekeeping_job.start()

    try:
        perform_analysis()
    except KeyboardInterrupt:
        logging.logger.info(
            "keyboard interrupt received, stopping housekeeping thread")
    except Exception:
        logging.logger.error(traceback.format_exc())
    finally:
        logging.logger.info(
            "asking housekeeping jobs to shutdown after finishing")
        housekeeping_job.shutdown_flag.set()
        housekeeping_job.join()

    logging.logger.info("finished performing outlier detection")