Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Unified Diff: read_log.py

Issue 3018633002: add a read_log.py flie
Patch Set: add a read_log.py flie Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698