本文整理汇总了Python中analyzer.Analyzer.run方法的典型用法代码示例。如果您正苦于以下问题:Python Analyzer.run方法的具体用法?Python Analyzer.run怎么用?Python Analyzer.run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类analyzer.Analyzer
的用法示例。
在下文中一共展示了Analyzer.run方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from analyzer import Analyzer [as 别名]
# 或者: from analyzer.Analyzer import run [as 别名]
def main(path):
files = [join(path, f) for f in listdir(path) if isfile(join(path, f)) and fnmatch(f, '*.zip')]
reports = []
for filename in files:
print >> sys.stderr, "Processing report %s" % filename
rep = report.Report(filename)
reports.append(rep)
an = Analyzer(reports)
an.run()
示例2: main
# 需要导入模块: from analyzer import Analyzer [as 别名]
# 或者: from analyzer.Analyzer import run [as 别名]
def main(logfile):
analyzer = Analyzer (logfile)
all_actions = analyzer.run()
params = []
for adpt_point,actions in all_actions.iteritems():
actionsstr = [str(a) for a in actions]
params.append (";".join(actionsstr))
#print ("\n:: Add the following parameter (opt plan) to your application ::")
print ("%s" % ";".join(params))
示例3: analyze
# 需要导入模块: from analyzer import Analyzer [as 别名]
# 或者: from analyzer.Analyzer import run [as 别名]
def analyze(self):
analyzer = Analyzer(self)
analyzer.run()
self.last_analyzed = datetime.datetime.now()
self.save()
return analyzer.run()
示例4: main
# 需要导入模块: from analyzer import Analyzer [as 别名]
# 或者: from analyzer.Analyzer import run [as 别名]
def main():
# parse command line
option = parse_cmdline()
filtered_devices_id = option.devices
is_list_devices = int(option.list_devices)
filtered_cases_id = option.cases
is_list_cases = int(option.list_cases)
case_file = option.case_file
executable = option.executable
# check command line
if is_list_devices:
list_devices(is_list_devices)
return
if is_list_cases:
list_cases(is_list_cases)
return
if not os.path.isfile(executable):
print "Error: " + executable + " doesn't exist."
return
# parse cases
all_cases = CaseSet()
if (case_file != ""):
all_cases.parse_xml(os.path.join(os.path.dirname(__file__), case_file))
else:
all_cases.parse_xml_dir(os.path.join(os.path.dirname(__file__), "..", "cases"))
filtered_case_set = {}
if filtered_cases_id:
for c in filtered_cases_id:
if c in all_cases.keys():
filtered_case_set[c] = all_cases[c]
else:
print "Warning: " + c + " is not an legal case ID."
else:
filtered_case_set = all_cases
# parse devices
all_devices = DeviceSet()
all_devices.parse_xml(os.path.join(os.path.dirname(__file__), "..", "devices", "devices.xml"))
filtered_device_set = {}
for d in filtered_devices_id:
if d in all_devices.keys():
filtered_device_set[d] = all_devices[d]
else:
print "Warning: " + d + " is not an legal device ID."
# execute profiling
e = Executor(executable, filtered_device_set, filtered_case_set, duplicate=10)
try:
logfiles = e.run()
except (KeyboardInterrupt):
print "KeyboardInterrupt in run.main()"
sys.exit()
# analyze log
for case_id in logfiles.keys():
for device_id in logfiles[case_id].keys():
case = all_cases[case_id]
root_node = case.get_root_node()
coeff = case.get_mcps_norm_coeff()
interest_nodes = option.interest_nodes
ana = Analyzer(root_node, coeff, interest_nodes)
if len(logfiles[case_id][device_id]) > 0:
ana.run(logfiles[case_id][device_id])
print "Finished! \nSee profile logs here: "
for dir in e.get_reports_dir():
print "\t./" + dir