How to use cgexec method in autotest

Best Python code snippet using autotest_python

benchmark.py

Source:benchmark.py Github

copy

Full Screen

1import pandas as pd2import matplotlib.pyplot as plt3import subprocess4import getopt5import sys6import time7import os8import re9comparison = False10round_robin = False11comparison_update = False12full_path = os.path.realpath(__file__)13path, filename = os.path.split(full_path)14webservers = ["nginx", "apache", "lighttpd"]15def start_nginx():16 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./nginx.o"])17 18def start_lighttpd():19 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./lighttpd.o -f " + path + "/config/lighttpd.conf"])20def start_apache():21 subprocess.run(["rm", "etc/apache/logs/httpd.pid"])22 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./apache.o -f " + path + "/config/apache.conf"])23def start_web_server(name):24 if name == "nginx":25 start_nginx()26 elif name == "lighttpd":27 start_lighttpd()28 elif name == "apache":29 start_apache()30def terminate_web_servers():31 print("Terminate running webservers...")32 for webserver in webservers:33 subprocess.run(["pkill", webserver])34def start_apache_benchmark(f):35 return subprocess.Popen(["ab", "-g", f, "-n", str(REQUESTS), "-H", "Connection: close", "-s", "10", "-c", "8", "http://localhost/v1.html"])36def start_wrk_benchmark(f):37 subprocess.run(["./wrk.o", "-t", "8", "-c", "64", "-d", "180s", "http://localhost/v1.html"], stdout=f)38def start_wrk_benchmark_async(f):39 return subprocess.Popen(["./wrk.o", "-t", "8", "-c", "64", "-d", "60s", "http://localhost/v1.html"], stdout=f)40try:41 opts, args = getopt.getopt(sys.argv[1:], "cru", ["run"])42except getopt.GetoptError as err:43 print(err)44 sys.exit(2)45 46for o, a in opts:47 if o == "-c":48 comparison = True49 if o == "-r":50 round_robin = True51 if o == "-u":52 comparison_update = True53if comparison:54 55 WAIT_COMP = 1556 terminate_web_servers()57 58 with open("comparison.txt", "w") as f:59 print("CPU bounded 1 thread")60 subprocess.run(["cgset", "-r", "cpuset.cpus=1-4", "openDSU"])61 subprocess.run(["cgset", "-r", "cpuset.mems=0", "openDSU"])62 print("Start openDSU nginx")63 f.write("openDSU nginx\n")64 f.flush()65 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./nginx.o"])66 start_wrk_benchmark(f)67 terminate_web_servers()68 time.sleep(WAIT_COMP)69 print("Start nginx")70 f.write("Nginx\n")71 f.flush()72 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "./nginx.o"])73 start_wrk_benchmark(f)74 terminate_web_servers()75 time.sleep(WAIT_COMP)76 sys.exit(0)77 print("CPU bounded 1 thread")78 subprocess.run(["cgset", "-r", "cpuset.cpus=1", "openDSU"])79 subprocess.run(["cgset", "-r", "cpuset.mems=0", "openDSU"])80 print("Start openDSU nginx")81 f.write("openDSU nginx\n")82 f.flush()83 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./nginx.o"])84 start_wrk_benchmark(f)85 terminate_web_servers()86 time.sleep(WAIT_COMP)87 print("Start nginx")88 f.write("Nginx\n")89 f.flush()90 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "./nginx.o"])91 start_wrk_benchmark(f)92 terminate_web_servers()93 time.sleep(WAIT_COMP)94 print("Start openDSU lighttpd")95 f.write("openDSU lighttpd\n")96 f.flush()97 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./lighttpd.o -f config/lighttpd.conf"])98 start_wrk_benchmark(f)99 terminate_web_servers()100 time.sleep(WAIT_COMP)101 print("Start lighttpd")102 f.write("lighttpd\n")103 f.flush()104 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "./lighttpd.o", "-f", "config/lighttpd.conf"])105 start_wrk_benchmark(f)106 terminate_web_servers()107 time.sleep(WAIT_COMP)108 print("Start openDSU apache")109 f.write("openDSU apache\n")110 f.flush()111 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./apache.o -f ../../config/apache.conf"])112 start_wrk_benchmark(f)113 terminate_web_servers()114 time.sleep(WAIT_COMP)115 print("Start apache")116 f.write("apache\n")117 f.flush()118 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "./apache.o", "-f", "../../config/apache.conf"])119 start_wrk_benchmark(f)120 terminate_web_servers()121 time.sleep(WAIT_COMP)122 print("CPU bounded 2 threads")123 subprocess.run(["cgset", "-r", "cpuset.cpus=1-2", "openDSU"])124 print("Start openDSU nginx")125 f.write("openDSU nginx\n")126 f.flush()127 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./nginx.o"])128 start_wrk_benchmark(f)129 terminate_web_servers()130 time.sleep(WAIT_COMP)131 print("Start nginx")132 f.write("Nginx\n")133 f.flush()134 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "./nginx.o"])135 start_wrk_benchmark(f)136 terminate_web_servers()137 time.sleep(WAIT_COMP)138 print("Start openDSU lighttpd")139 f.write("openDSU lighttpd\n")140 f.flush()141 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./lighttpd.o -f config/lighttpd.conf"])142 start_wrk_benchmark(f)143 terminate_web_servers()144 time.sleep(WAIT_COMP)145 print("Start lighttpd")146 f.write("lighttpd\n")147 f.flush()148 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "./lighttpd.o", "-f", "config/lighttpd.conf"])149 start_wrk_benchmark(f)150 terminate_web_servers()151 time.sleep(WAIT_COMP)152 print("Start openDSU apache")153 f.write("openDSU apache\n")154 f.flush()155 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./apache.o -f ../../config/apache.conf"])156 start_wrk_benchmark(f)157 terminate_web_servers()158 time.sleep(WAIT_COMP)159 print("Start apache")160 f.write("apache\n")161 f.flush()162 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "./apache.o", "-f", "../../config/apache.conf"])163 start_wrk_benchmark(f)164 terminate_web_servers()165 time.sleep(WAIT_COMP)166 print("CPU bounded 4 threads")167 subprocess.run(["cgset", "-r", "cpuset.cpus=1-4", "openDSU"])168 print("Start openDSU apache")169 f.write("openDSU apache\n")170 f.flush()171 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./apache.o -f ../../config/apache.conf"])172 start_wrk_benchmark(f)173 terminate_web_servers()174 time.sleep(WAIT_COMP)175 print("Start apache")176 f.write("apache\n")177 f.flush()178 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "./apache.o", "-f", "../../config/apache.conf"])179 start_wrk_benchmark(f)180 terminate_web_servers()181 time.sleep(WAIT_COMP)182if comparison_update:183 184 WAIT_COMP = 15185 terminate_web_servers()186 187 with open("comparison_update.txt", "w") as f:188 subprocess.run(["cgset", "-r", "cpuset.cpus=1-4", "openDSU"])189 subprocess.run(["cgset", "-r", "cpuset.mems=0", "openDSU"])190 191 print("Start openDSU nginx")192 f.write("openDSU nginx\n")193 f.flush()194 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./nginx.o"])195 p = start_wrk_benchmark_async(f)196 time.sleep(10)197 print("Start openDSU nginx")198 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./nginx.o"])199 time.sleep(10)200 print("Start openDSU nginx")201 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./nginx.o"])202 time.sleep(10)203 print("Start openDSU nginx")204 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./nginx.o"])205 time.sleep(10)206 print("Start openDSU nginx")207 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./nginx.o"])208 time.sleep(10)209 print("Start openDSU nginx")210 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./nginx.o"])211 p.wait()212 terminate_web_servers()213 sys.exit(0)214 time.sleep(WAIT_COMP)215 subprocess.run(["cgset", "-r", "cpuset.cpus=1", "openDSU"])216 subprocess.run(["cgset", "-r", "cpuset.mems=0", "openDSU"])217 print("Start openDSU lighttpd")218 f.write("openDSU lighttpd\n")219 f.flush()220 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./lighttpd.o -f config/lighttpd.conf"])221 p = start_wrk_benchmark_async(f)222 time.sleep(10)223 print("Start openDSU lighttpd")224 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./lighttpd.o -f config/lighttpd.conf"])225 time.sleep(10)226 print("Start openDSU lighttpd")227 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./lighttpd.o -f config/lighttpd.conf"])228 time.sleep(10)229 print("Start openDSU lighttpd")230 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./lighttpd.o -f config/lighttpd.conf"])231 time.sleep(10)232 print("Start openDSU lighttpd")233 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./lighttpd.o -f config/lighttpd.conf"])234 time.sleep(10)235 print("Start openDSU lighttpd")236 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./lighttpd.o -f config/lighttpd.conf"])237 p.wait()238 terminate_web_servers()239 time.sleep(WAIT_COMP)240 subprocess.run(["cgset", "-r", "cpuset.cpus=1-4", "openDSU"])241 subprocess.run(["cgset", "-r", "cpuset.mems=0", "openDSU"])242 243 print("Start openDSU apache")244 f.write("openDSU apache\n")245 f.flush()246 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./apache.o -f ../../config/apache.conf"])247 p = start_wrk_benchmark_async(f)248 time.sleep(10)249 print("Start openDSU apache")250 subprocess.run(["rm", "etc/apache/logs/httpd.pid"])251 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./apache.o -f ../../config/apache.conf"])252 time.sleep(10)253 print("Start openDSU apache")254 subprocess.run(["rm", "etc/apache/logs/httpd.pid"])255 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./apache.o -f ../../config/apache.conf"])256 time.sleep(10)257 print("Start openDSU apache")258 subprocess.run(["rm", "etc/apache/logs/httpd.pid"])259 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./apache.o -f ../../config/apache.conf"])260 time.sleep(10)261 print("Start openDSU apache")262 subprocess.run(["rm", "etc/apache/logs/httpd.pid"])263 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./apache.o -f ../../config/apache.conf"])264 time.sleep(10)265 print("Start openDSU apache")266 subprocess.run(["rm", "etc/apache/logs/httpd.pid"])267 subprocess.run(["cgexec", "-g", "cpuset:openDSU", "--sticky", "openDSU", "./apache.o -f ../../config/apache.conf"])268 p.wait()269 270 terminate_web_servers()271 272 273if round_robin:274 #REQUESTS = 6000000275 REQUESTS = 5000000276 ROUND_ROBIN_TIME = 30277 #REQUESTS = 500000278 #ROUND_ROBIN_TIME = 3279 280 281 terminate_web_servers()282 subprocess.run(["cgset", "-r", "cpuset.cpus=1", "openDSU"])283 subprocess.run(["cgset", "-r", "cpuset.mems=0", "openDSU"])284 285 with open("round_robin_update.plt", "w") as f:286 f.write("seconds\n")287 f.flush()288 289 print('Start nginx')290 start_nginx()291 print('Start benchmarking')292 p = start_apache_benchmark("round_robin.plt")293 time.sleep(ROUND_ROBIN_TIME + 5)294 print('Update to apache')295 start_apache()296 f.write(str(int(time.time())) + "\n")297 f.flush()298 time.sleep(ROUND_ROBIN_TIME)299 print('Update to lighttpd')300 start_lighttpd()301 f.write(str(int(time.time())) + "\n")302 f.flush()303 time.sleep(ROUND_ROBIN_TIME)304 print('Update to nginx')305 start_nginx()306 f.write(str(int(time.time())) + "\n")307 f.flush()308 time.sleep(ROUND_ROBIN_TIME)309 print('Update to apache')310 start_apache()311 f.write(str(int(time.time())) + "\n")312 f.flush()313 time.sleep(ROUND_ROBIN_TIME)314 print('Update to lighttpd')315 start_lighttpd()316 f.write(str(int(time.time())) + "\n")317 f.flush()318 time.sleep(ROUND_ROBIN_TIME)319 320 p.wait()321 322 print('Terminate webservers')323 #terminate_web_servers()324 325 print('End')326if os.path.exists("round_robin1.plt") and os.path.exists("round_robin_update1.plt"):327 f = {'seconds':'first', 'ctime':'mean', 'dtime':'mean', 'ttime':'mean', 'wait':'mean'}328 df1 = pd.read_csv('round_robin1.plt', sep='\t', index_col=0)329 df2 = pd.read_csv('round_robin_update1.plt', sep='\t')330 df1.sort_values(by=['seconds'], inplace=True)331 df1 = df1.groupby(['seconds']).size().reset_index(name='counts')332 corr1 = df1['seconds'].iloc[0]333 df1['seconds'] -= corr1334 df2['seconds'] -= corr1335 maximum= max(df1['counts'][5:175])336 plt.plot(df1['seconds'][5:175], df1['counts'][5:175], 'k-', label='openDSU')337 for index, row in df2.iterrows():338 plt.plot([row['seconds'], row['seconds']], [0, maximum], 'k--') # Horizontal line339 f = {'seconds':'first', 'ctime':'mean', 'dtime':'mean', 'ttime':'mean', 'wait':'mean'}340 df3 = pd.read_csv('round_robin2.plt', sep='\t', index_col=0)341 df4 = pd.read_csv('round_robin_update2.plt', sep='\t')342 df3.sort_values(by=['seconds'], inplace=True)343 df3 = df3.groupby(['seconds']).size().reset_index(name='counts')344 corr3 = df3['seconds'].iloc[0]345 df3['seconds'] -= corr3346 df4['seconds'] -= corr3347 maximum= max(df3['counts'][5:175])348 plt.plot(df3['seconds'][5:175], df3['counts'][5:175], 'k-', label='openDSU')349 #for index, row in df4.iterrows():350 # plt.plot([row['seconds'], row['seconds']], [0, maximum], 'k--') # Horizontal line351 f = {'seconds':'first', 'ctime':'mean', 'dtime':'mean', 'ttime':'mean', 'wait':'mean'}352 df5 = pd.read_csv('round_robin3.plt', sep='\t', index_col=0)353 df6 = pd.read_csv('round_robin_update3.plt', sep='\t')354 df5.sort_values(by=['seconds'], inplace=True)355 df5 = df5.groupby(['seconds']).size().reset_index(name='counts')356 corr5 = df5['seconds'].iloc[0]357 df5['seconds'] -= corr5358 df6['seconds'] -= corr5359 maximum= max(df5['counts'][5:175])360 plt.plot(df5['seconds'][5:175], df5['counts'][5:175], 'k-', label='openDSU')361 #for index, row in df6.iterrows():362 # plt.plot([row['seconds'], row['seconds']], [0, maximum], 'k--') # Horizontal line363 364 plt.ylim((0,None))365 plt.xlim((5,175))366 plt.ylabel('request/second')367 plt.xlabel('Time in seconds')368 plt.text(17, 1000, "Nginx")369 plt.text(42, 1000, "Apache httpd")370 plt.text(76, 1000, "Lighttpd")371 plt.text(107, 1000, "Nginx")372 plt.text(133, 1000, "Apache httpd")373 plt.text(161, 1000, "Lighttpd")374 #plt.text(38, 1000, "Lighttpd")375 plt.show()376if exists("round_robin.plt") and exists("round_robin_update.plt"):377 data = []378 row = []379 with open("comparison.txt", "r") as f:380 381 for line in f:382 383 for webserver in webservers:384 m = re.match("\W*" + webserver, line)385 if m != None:386 if len(row) > 0:387 data.append(row)388 row = [webserver, 0, 0]389 m = re.match("\W*openDSU *" + webserver, line)390 if m != None:391 if len(row) > 0:392 data.append(row)393 row = ["openDSU " + webserver, 0, 0]394 395 # Latency 12.13ms 54.33ms 1.23s 98.67%396 m = re.match("\W*Latency *\d+\.\d+[A-Za-z]{2}", line)397 if m != None:398 row[1] = re.findall("\d+\.\d+[A-Za-z]{2}", line)[0]399 # Req/Sec 36.03k 3.12k 61.36k 91.05%400 m = re.match("\W*Req/Sec *\d+\.\d+[A-Za-z]{1}", line)401 if m != None:402 row[2] = re.findall("\d+\.\d+[A-Za-z]{1}", line)[0]403 if len(row) > 0:404 data.append(row)405 print(data)406sys.exit(0)407fig, axes = plt.subplots(1, 1)408plt.plot(df1['seconds'][5:], df1['ttime'][5:], 'k-', label='openDSU (Nginx)')409maximum= max(df1['ttime'][5:])410for index, row in df2.iterrows():411 plt.plot([row['seconds'], row['seconds']], [0, 412], 'k--') # Horizontal line413plt.ylim((0,None))414plt.xlabel('Duration (s)')415plt.ylabel('Latency (ms)')416plt.legend()417plt.title(label=str(int(REQUESTS/max(df1['seconds']))) + " req/sec during " + str(UPDATES) + " updates")418print(data)419#tbl = axes[1].table(cellText=data, loc="center", colLoc='left', rowLoc='left', cellLoc='left', colLabels= ['', 'latency', 'req/sec'])420#axes[1].axis("off")421#axes[1].set_title(label="Comparison without implementation")422#tbl.auto_set_font_size(False)423#tbl.set_fontsize(14)...

Full Screen

Full Screen

manager.py

Source:manager.py Github

copy

Full Screen

1import logging2import os3import time4import redis5from kazoo.client import KazooClient6from pykit import threadutil7from pykit import utfjson8from pykit import zkutil9from pykit.cgrouparch import account10from pykit.cgrouparch import cgroup_manager11from pykit.cgrouparch import communicate12logger = logging.getLogger(__name__)13global_value = {}14def init_redis_client(context):15 client = redis.StrictRedis(context['redis_ip'], context['redis_port'])16 context['redis_client'] = client17def get_zk_client(context):18 host = context['get_zk_host']()19 zk_client = KazooClient(hosts=host, timeout=3.0, randomize_hosts=True,20 auth_data=context['zk_auth_data'], logger=logger)21 zk_client.start()22 return zk_client23def update_conf(event):24 logger.info('update conf triggered at: %f' % time.time())25 context = global_value['context']26 zk_path = '%s/arch_conf' % context['zk_prefix']27 while True:28 try:29 zk_client = context['zk_client']30 resp = zk_client.get(zk_path, watch=update_conf)31 break32 except Exception as e:33 logger.exception('failed to get from zk: ' + repr(e))34 time.sleep(5)35 context['arch_conf'] = {36 'version': resp[1].version,37 'value': utfjson.load(resp[0]),38 }39 logger.info('arch conf in zk changed at: %f, current verrsion: %d' %40 (time.time(), resp[1].version))41 cgroup_manager.build_all_subsystem_cgroup_arch(context)42def on_lost(stat):43 logger.warn('zk client on lost, stat is: %s, about to exit' % str(stat))44 os._exit(2)45def init_arch_conf(context):46 while True:47 try:48 if context['zk_client'] is None:49 context['zk_client'] = get_zk_client(context)50 context['zk_client'].add_listener(on_lost)51 zk_path = '%s/arch_conf' % context['zk_prefix']52 resp = context['zk_client'].get(zk_path, watch=update_conf)53 context['arch_conf'] = {54 'version': resp[1].version,55 'value': utfjson.load(resp[0]),56 }57 return58 except Exception as e:59 logger.warn('failed to get arch conf from zk: %s' % repr(e))60 zkutil.close_zk(context['zk_client'])61 context['zk_client'] = None62 time.sleep(10)63def update_cgexec_arg(cgexec_arg, subsystem_name, cgroup_relative_path,64 cgroup_conf):65 sub_cgroup = cgroup_conf.get('sub_cgroup')66 if sub_cgroup is None:67 return68 for sub_cgroup_name, sub_cgroup_conf in sub_cgroup.iteritems():69 sub_relative_path = cgroup_relative_path + '/' + sub_cgroup_name70 if sub_cgroup_name in cgexec_arg:71 cgexec_arg[sub_cgroup_name] += ' -g %s:%s' % (72 subsystem_name, sub_relative_path)73 update_cgexec_arg(cgexec_arg, subsystem_name, sub_relative_path,74 sub_cgroup_conf)75def get_cgexec_arg(cgroup_names, **argkv):76 context = {77 'cgroup_dir': argkv.get('cgroup_dir', '/sys/fs/cgroup'),78 'get_zk_host': argkv['get_zk_host'],79 'zk_prefix': argkv['zk_prefix'],80 'zk_auth_data': argkv['zk_auth_data'],81 }82 cgexec_arg = {}83 for cgroup_name in cgroup_names:84 cgexec_arg[cgroup_name] = ''85 try:86 zk_client = get_zk_client(context)87 zk_path = '%s/arch_conf' % context['zk_prefix']88 resp = zk_client.get(zk_path)89 zkutil.close_zk(zk_client)90 context['arch_conf'] = {91 'version': resp[1].version,92 'value': utfjson.load(resp[0]),93 }94 cgroup_manager.build_all_subsystem_cgroup_arch(context)95 arch_conf_value = context['arch_conf']['value']96 for subsystem_name, subsystem_conf in arch_conf_value.iteritems():97 cgroup_relative_path = ''98 cgroup_conf = subsystem_conf99 update_cgexec_arg(cgexec_arg, subsystem_name,100 cgroup_relative_path, cgroup_conf)101 return cgexec_arg102 except Exception as e:103 logger.exception('failed to get cgexec arg: ' + repr(e))104 return cgexec_arg105def run(**argkv):106 context = {107 'get_cgroup_pid_file': argkv['get_cgroup_pid_file'],108 'cgroup_dir': argkv.get('cgroup_dir', '/sys/fs/cgroup'),109 'communicate_ip': argkv.get('communicate_ip', '0.0.0.0'),110 'communicate_port': argkv.get('communicate_port', 43409),111 'tasks_update_interval': argkv.get('tasks_update_interval', 30),112 'redis_ip': argkv['redis_ip'],113 'redis_port': argkv['redis_port'],114 'redis_prefix': argkv.get('redis_prefix', 'cgroup_arch'),115 'redis_client': None,116 'redis_expire_time': argkv.get('redis_expire_time', 60 * 5),117 'get_zk_host': argkv['get_zk_host'],118 'zk_prefix': argkv['zk_prefix'],119 'zk_auth_data': argkv['zk_auth_data'],120 'zk_client': None,121 'protected_cgroup': argkv.get('protected_cgroup'),122 'arch_conf': None,123 }124 init_redis_client(context)125 init_arch_conf(context)126 global_value['context'] = context127 cgroup_manager.build_all_subsystem_cgroup_arch(context)128 cgroup_manager.set_cgroup(context)129 cgroup_manager.reset_statistics(context)130 threadutil.start_daemon_thread(account.run, args=(context,))131 threadutil.start_daemon_thread(cgroup_manager.loop_set_cgroup,132 args=(context,))133 communicate.run(context, ip=context['communicate_ip'],...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful