Chromium Code Reviews| Index: tools/perf/list_system_health_stories |
| diff --git a/tools/perf/list_system_health_stories b/tools/perf/list_system_health_stories |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..5c9f5b9686aa424f187bc628608956dc6d185c76 |
| --- /dev/null |
| +++ b/tools/perf/list_system_health_stories |
| @@ -0,0 +1,36 @@ |
| +#!/usr/bin/env python |
| +# Copyright 2016 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +import sys |
| + |
| +from core import path_util |
| +sys.path.insert(1, path_util.GetTelemetryDir()) # To resolve telemetry imports |
| + |
| +import page_sets |
| + |
|
perezju
2016/10/17 08:28:54
nit: these should be 2 blank lines.
nednguyen
2016/10/21 11:34:48
Done.
|
| +def IterAllSystemHealthStories(): |
| + for s in page_sets.SystemHealthStorySet(platform='desktop'): |
| + yield s |
| + for s in page_sets.SystemHealthStorySet(platform='mobile'): |
| + if len(s.SUPPORTED_PLATFORMS) < 2: |
| + yield s |
|
perezju
2016/10/17 08:28:54
There are some stories that have support for both
nednguyen
2016/10/21 11:34:48
They are listed differently because the workflow a
perezju
2016/10/21 11:50:39
To me sounds like an implementation detail leaking
|
| + |
|
perezju
2016/10/17 08:28:54
nit: 2 blank lines
nednguyen
2016/10/21 11:34:48
Done.
|
| +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) |
| + return 0 |
| + |
| + |
| +if __name__ == '__main__': |
| + sys.exit(main()) |