本文整理汇总了Python中profile.Profile.initialize方法的典型用法代码示例。如果您正苦于以下问题:Python Profile.initialize方法的具体用法?Python Profile.initialize怎么用?Python Profile.initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类profile.Profile
的用法示例。
在下文中一共展示了Profile.initialize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_addon_perf
# 需要导入模块: from profile import Profile [as 别名]
# 或者: from profile.Profile import initialize [as 别名]
def test_addon_perf():
firefox = FirefoxRunner(binary='firefox/firefox')
profile = Profile()
profile.initialize(runner=firefox)
t = Talos(profile=profile, firefox=firefox, talos_dir='talos')
results = []
cycles = 10
for i in range(0, cycles):
#time.sleep(10)
results.append(t.run_ts(cycles=1)[0])
print results
示例2: int
# 需要导入模块: from profile import Profile [as 别名]
# 或者: from profile.Profile import initialize [as 别名]
time.sleep(20)
results.append(t.run_ts(cycles=1)[0])
rawWriter.writerow([name] + results)
raw_file.flush()
average = int(round(reduce(lambda x, y: int(x)+int(y), results) / cycles))
resultsWriter.writerow([name, average])
results_file.flush()
resultsWriter.writerow(['addon_name', 'ts_average'])
rawWriter.writerow(['addon_name', 'ts1', 'ts2', 'ts3'])
# no addons
prof = Profile()
prof.initialize(runner=firefox)
run_talos(prof, "<empty profile>")
#prof = Profile()
prof.initialize(runner=firefox)
run_talos(prof, "<empty profile>")
# top addons
f = open('topaddons.csv', "r")
reader = csv.reader(f, delimiter=',')
topaddons = map(lambda a : a, reader)
for i in range(1, 1000):
addon_info = topaddons[i]
url = addon_info[0]
name = addon_info[1]