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

Unified Diff: tools/perf/generate_system_health_csv

Issue 2888133002: Modify list_system_health_stories to generate_system_health_csv (Closed)
Patch Set: Address Juan's nits Created 3 years, 7 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 | tools/perf/list_system_health_stories » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/generate_system_health_csv
diff --git a/tools/perf/list_system_health_stories b/tools/perf/generate_system_health_csv
similarity index 59%
rename from tools/perf/list_system_health_stories
rename to tools/perf/generate_system_health_csv
index cfc494a279c08fb54c03514ac3d00273cdb10c7d..aa1c079f5c5daa34fa178d1b9ae396a79d217507 100755
--- a/tools/perf/list_system_health_stories
+++ b/tools/perf/generate_system_health_csv
@@ -3,6 +3,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import csv
+import os
import sys
from core import path_util
@@ -18,19 +20,24 @@ def IterAllSystemHealthStories():
if len(s.SUPPORTED_PLATFORMS) < 2:
yield s
+SYSTEM_HEALTH_CSV = os.path.join(os.path.dirname(__file__),
+ 'system_health_stories.csv')
+
def main():
system_health_stories = list(IterAllSystemHealthStories())
system_health_stories.sort(key=lambda s: s.name)
- print '{0:60} {1}'.format('Story name', 'Supported platform')
- print '-' * 79
- for s in system_health_stories:
- p = s.SUPPORTED_PLATFORMS
- if len(p) == 2:
- p = 'all'
- else:
- p = list(p)[0]
- print '{0:60} {1}'.format(s.name, p)
+ with open(SYSTEM_HEALTH_CSV, 'w') as f:
+ csv_writer = csv.writer(f)
+ csv_writer.writerow([
+ 'Story name', 'Platform', 'Description'])
+ for s in system_health_stories:
+ p = s.SUPPORTED_PLATFORMS
+ if len(p) == 2:
+ p = 'all'
+ else:
+ p = list(p)[0]
+ csv_writer.writerow([s.name, p, s.GetStoryDescription()])
return 0
« no previous file with comments | « no previous file | tools/perf/list_system_health_stories » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698