| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from core import perf_benchmark | 5 from core import perf_benchmark |
| 6 | 6 |
| 7 import page_sets |
| 7 from telemetry import benchmark | 8 from telemetry import benchmark |
| 8 from telemetry.core import discover | 9 from telemetry.core import discover |
| 9 from telemetry import story | 10 from telemetry import story |
| 10 | 11 |
| 11 from measurements import skpicture_printer | 12 from measurements import skpicture_printer |
| 12 | 13 |
| 13 | 14 |
| 14 def _MatchPageSetName(story_set_name, story_set_base_dir): | 15 def _MatchPageSetName(story_set_name, story_set_base_dir): |
| 15 story_sets = discover.DiscoverClasses(story_set_base_dir, story_set_base_dir, | 16 story_sets = discover.DiscoverClasses(story_set_base_dir, story_set_base_dir, |
| 16 story.StorySet).values() | 17 story.StorySet).values() |
| (...skipping 24 matching lines...) Expand all Loading... |
| 41 def Name(cls): | 42 def Name(cls): |
| 42 return 'skpicture_printer' | 43 return 'skpicture_printer' |
| 43 | 44 |
| 44 def CreatePageTest(self, options): | 45 def CreatePageTest(self, options): |
| 45 return skpicture_printer.SkpicturePrinter(options.skp_outdir) | 46 return skpicture_printer.SkpicturePrinter(options.skp_outdir) |
| 46 | 47 |
| 47 def CreateStorySet(self, options): | 48 def CreateStorySet(self, options): |
| 48 story_set_class = _MatchPageSetName(options.page_set_name, | 49 story_set_class = _MatchPageSetName(options.page_set_name, |
| 49 options.page_set_base_dir) | 50 options.page_set_base_dir) |
| 50 return story_set_class() | 51 return story_set_class() |
| 52 |
| 53 |
| 54 @benchmark.Disabled |
| 55 class SkpicturePrinterCT(perf_benchmark.PerfBenchmark): |
| 56 """Captures SKPs for Cluster Telemetry.""" |
| 57 |
| 58 @classmethod |
| 59 def Name(cls): |
| 60 return 'skpicture_printer_ct' |
| 61 |
| 62 @classmethod |
| 63 def AddBenchmarkCommandLineArgs(cls, parser): |
| 64 parser.add_option('--user-agent', action='store', type='string', |
| 65 default=None, help='Options are mobile and desktop.') |
| 66 parser.add_option('--archive-data-file', action='store', type='string', |
| 67 default=None, |
| 68 help='The location of the WPR JSON archive file.') |
| 69 parser.add_option('--urls-list', action='store', type='string', |
| 70 default=None, |
| 71 help='This is a comma separated list of urls. ' |
| 72 'Eg: http://www.google.com,http://www.gmail.com') |
| 73 parser.add_option('-s', '--skp-outdir', |
| 74 default=None, |
| 75 help='Output directory for the SKP files') |
| 76 |
| 77 @classmethod |
| 78 def ProcessCommandLineArgs(cls, parser, args): |
| 79 if not args.user_agent: |
| 80 parser.error('Please specify --user_agent.') |
| 81 if not args.archive_data_file: |
| 82 parser.error('Please specify --archive_data_file.') |
| 83 if not args.urls_list: |
| 84 parser.error('Please specify --urls_list.') |
| 85 |
| 86 def CreatePageTest(self, options): |
| 87 return skpicture_printer.SkpicturePrinter(options.skp_outdir) |
| 88 |
| 89 def CreateStorySet(self, options): |
| 90 return page_sets.CTPageSet( |
| 91 options.urls_list, options.user_agent, options.archive_data_file) |
| OLD | NEW |