-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathshell.py
31 lines (27 loc) · 1.06 KB
/
shell.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import os
from subprocess import call
import sys
Name = ["Apsara", "Fastcgi", "Metering","Monitor","Ols","Op","Oss", "Pangu", "PAudit", "Presto", "PSummary", "Request", "Rpc", "Shennong", "Sinput", "Sla", "Sys", "Tubo"]
def makeDir():
for n in Name:
os.mkdir(os.path.join("./out/", n))
def training(path):
for n in Name:
input_path = os.path.join(path, n+".log")
template_path = os.path.join("./template/", n)
command = "python3 training.py " + "-I " + input_path + " -T " + template_path
print(command)
call(command, shell=True)
def compression(path):
for n in Name:
input_path = os.path.join(path, n+".log")
template_path = os.path.join("./template/", n)
output_path = os.path.join("./out/", n)
command = "python3 LogReducer.py " + "-I " + input_path + " -T " + template_path + " -O " + output_path
print(command)
call(command, shell=True)
if __name__ == "__main__":
input_path = sys.argv[1]
makeDir()
training(input_path)
compression(input_path)