def set_current_config(config): _GLOBAL_CONTEXT["config"] = config if config["add_network_latency"] != "0" and config["add_network_latency"]: from mrq.monkey import patch_network_latency patch_network_latency(config["add_network_latency"]) if config["print_mongodb"] or config["trace_io"]: from mrq.monkey import patch_pymongo patch_pymongo(config) if config["trace_io"]: from mrq.monkey import patch_io_all patch_io_all(config)
def set_current_config(config): global _CONFIG _CONFIG = config log.quiet = config["quiet"] if config["trace_mongodb"] or config["print_mongodb"]: from mrq.monkey import patch_pymongo patch_pymongo(config) if config["add_latency"]: from mrq.monkey import patch_network_latency patch_network_latency(config["add_latency"]) if not config["no_import_patch"]: from mrq.monkey import patch_import patch_import()
def set_current_config(config): _GLOBAL_CONTEXT["config"] = config log.quiet = config["quiet"] if config["add_network_latency"] != "0" and config["add_network_latency"]: from mrq.monkey import patch_network_latency patch_network_latency(config["add_network_latency"]) if config["print_mongodb"] or config["trace_io"]: from mrq.monkey import patch_pymongo patch_pymongo(config) if config["trace_io"]: from mrq.monkey import patch_io_all patch_io_all(config) if config["mongodb_logs"] == "0": log.handler.collection = False
def set_current_config(config): _GLOBAL_CONTEXT["config"] = config if config["add_network_latency"] != "0" and config["add_network_latency"]: from mrq.monkey import patch_network_latency patch_network_latency(config["add_network_latency"]) if config["print_mongodb"] or config["trace_io"]: from mrq.monkey import patch_pymongo patch_pymongo(config) if config["trace_io"]: from mrq.monkey import patch_io_all patch_io_all(config) connections.mongodb_jobs.mrq_jobs.create_index([('trace_id', 1), ('datequeued', -1)], background=True, name='trace_id_index')