def __init__(self, logger, config, ip_manager, connection_manager, http1worker=Http1Worker, http2worker=Http2Worker): self.logger = logger self.config = config self.ip_manager = ip_manager self.connection_manager = connection_manager self.connection_manager.set_ssl_created_cb(self.on_ssl_created_cb) self.http1worker = http1worker self.http2worker = http2worker self.request_queue = Queue.Queue() self.workers = [] self.working_tasks = {} self.h1_num = 0 self.h2_num = 0 self.last_request_time = time.time() self.running = True self.triger_create_worker_cv = SimpleCondition() self.wait_a_worker_cv = simple_queue.Queue() threading.Thread(target=self.dispatcher).start() threading.Thread(target=self.create_worker_thread).start()
def __init__(self): self.request_queue = Queue.Queue() self.workers = [] self.working_tasks = {} self.h1_num = 0 self.h2_num = 0 self.create_worker_th = None self.last_request_time = time.time() self.triger_create_worker_cv = SimpleCondition() self.wait_a_worker_cv = SimpleCondition() threading.Thread(target=self.dispatcher).start() threading.Thread(target=self.create_worker_thread).start() # move created ssl to worker after ssl timeout https_manager.set_ssl_time_handler(self.on_ssl_created_cb)
def __init__(self, host, log_debug_data): self.host = host self.log_debug_data = log_debug_data self.request_queue = Queue.Queue() self.workers = [] self.working_tasks = {} self.h1_num = 0 self.h2_num = 0 self.create_worker_th = None self.last_request_time = time.time() self.triger_create_worker_cv = SimpleCondition() self.wait_a_worker_cv = SimpleCondition() threading.Thread(target=self.dispatcher).start() threading.Thread(target=self.create_worker_thread).start() # move created ssl to worker after ssl timeout self.https_manager = connect_manager.Https_connection_manager(host, self.on_ssl_created_cb)
def __init__(self, logger, config, ip_manager, connection_manager, http1worker=Http1Worker, http2worker=Http2Worker): self.logger = logger self.config = config self.ip_manager = ip_manager self.connection_manager = connection_manager self.connection_manager.set_ssl_created_cb(self.on_ssl_created_cb) self.http1worker = http1worker self.http2worker = http2worker self.request_queue = queue.Queue() self.workers = [] self.working_tasks = {} self.h1_num = 0 self.h2_num = 0 self.last_request_time = time.time() self.task_count_lock = threading.Lock() self.task_count = 0 self.running = True # for statistic self.success_num = 0 self.fail_num = 0 self.continue_fail_num = 0 self.last_fail_time = 0 self.rtts = [] self.last_sent = self.total_sent = 0 self.last_received = self.total_received = 0 self.second_stats = queue.deque() self.last_statistic_time = time.time() self.second_stat = { "rtt": 0, "sent": 0, "received": 0 } self.minute_stat = { "rtt": 0, "sent": 0, "received": 0 } self.trigger_create_worker_cv = SimpleCondition() self.wait_a_worker_cv = simple_queue.Queue() threading.Thread(target=self.dispatcher).start() threading.Thread(target=self.create_worker_thread).start() threading.Thread(target=self.connection_checker).start()