Chromium Code Reviews| Index: read_log.py |
| diff --git a/read_log.py b/read_log.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..aabac90c2b027a98677333f83489259bd4111180 |
| --- /dev/null |
| +++ b/read_log.py |
| @@ -0,0 +1,19 @@ |
| +import os |
| + |
| +FOLDER = "/Users/liangzijie/Desktop/testdemo/lx3/out/" |
|
01tonythomas
2017/09/25 19:55:09
We cannot have this going into the program, but I
|
| +FLAG = "OVERALL" |
| + |
| + |
| +def read_file(filename, pattern): |
|
01tonythomas
2017/09/25 19:55:09
minor, but for next time - the function name shoul
|
| + with open(filename) as f: |
| + lines = f.readlines() |
| + for line in lines: |
| + if pattern in line: |
| + print(line.strip()) |
| + |
| + |
| +for each_file in os.listdir(FOLDER): |
| + if each_file.startswith("2017"): |
| + filename = os.path.join(FOLDER + each_file, "load.ycsb.log") |
| + if os.path.exists(filename): |
| + read_file(filename, FLAG) |