def optimize_by_merge_sub_tree(): logPath = os.path.join(os.path.abspath(''), 'sample.log') drain = buildSampleDrain(logPath) t = drain.copy() createPlot(t) t = drain.copy() opt = Optimizer() opt.modify(method='merge_sub_tree', tree=t) # opt.modify(t) createPlot(t)
def optimize_by_seq_dist(): logPath = os.path.join(os.path.abspath(''), 'sample.log') drain = buildSampleDrain(logPath) logClusters = drain.logClusters printClusters(logClusters) opt = Optimizer() opt.modify(method='seq_dist', tree=drain.prefixTree, drain=drain, st=0.7) logClusters = drain.logClusters printClusters(logClusters) root = drain.copy() createPlot(root)
def optimize_by_merge_sub_tree(): drain = parse_log_data() # logPath = os.path.join(os.path.abspath(''), 'sample.log') # drain = buildSampleDrain(logPath) # createPlot(drain) opt = Optimizer() logClusters = drain.logClusters print('优化前') printClusters(logClusters) opt.modify(method='merge_sub_tree', tree=drain.prefixTree, drain=drain) logClusters = drain.logClusters print('合并子树优化') printClusters(logClusters) # createPlot(drain) opt.modify(method='seq_dist', tree=drain.prefixTree, drain=drain, st=0.8) logClusters = drain.logClusters print('合并聚类优化') printClusters(logClusters) drain.save() return drain