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

Unified Diff: systrace/profile_chrome/util.py

Issue 2712163002: [Systrace] Fix systrace clock syncing issue with BattOr. (Closed)
Patch Set: Created 3 years, 10 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
Index: systrace/profile_chrome/util.py
diff --git a/systrace/profile_chrome/util.py b/systrace/profile_chrome/util.py
index f5cb5bf370aa97c4eb59b71b32109f9db0cc6004..c87e5c490786b974c3595255f1fee501f1464d32 100644
--- a/systrace/profile_chrome/util.py
+++ b/systrace/profile_chrome/util.py
@@ -14,22 +14,17 @@ def ArchiveFiles(host_files, output):
z.write(host_file)
os.unlink(host_file)
+
def CompressFile(host_file, output):
with gzip.open(output, 'wb') as out, open(host_file, 'rb') as input_file:
out.write(input_file.read())
os.unlink(host_file)
-def ArchiveData(trace_results, output):
- with zipfile.ZipFile(output, 'w', zipfile.ZIP_DEFLATED) as z:
- for result in trace_results:
- trace_file = result.source_name + GetTraceTimestamp()
- WriteDataToCompressedFile(result.raw_data, trace_file)
- z.write(trace_file)
- os.unlink(trace_file)
def WriteDataToCompressedFile(data, output):
with gzip.open(output, 'wb') as out:
out.write(data)
+
def GetTraceTimestamp():
return time.strftime('%Y-%m-%d-%H%M%S', time.localtime())

Powered by Google App Engine
This is Rietveld 408576698