OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 import csv | 5 import csv |
6 import multiprocessing | 6 import multiprocessing |
7 import os | 7 import os |
8 import sys | 8 import sys |
9 | 9 |
10 from telemetry.core import exceptions | 10 from telemetry.core import exceptions |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 self._collector.start() | 72 self._collector.start() |
73 if not self._is_collecting.wait(timeout=0.5): | 73 if not self._is_collecting.wait(timeout=0.5): |
74 self._collector.terminate() | 74 self._collector.terminate() |
75 raise exceptions.ProfilingException('Failed to start data collection.') | 75 raise exceptions.ProfilingException('Failed to start data collection.') |
76 | 76 |
77 @classmethod | 77 @classmethod |
78 def name(cls): | 78 def name(cls): |
79 return 'monsoon' | 79 return 'monsoon' |
80 | 80 |
81 @classmethod | 81 @classmethod |
82 def is_supported(cls, options): | 82 def is_supported(cls, browser_type): |
83 if not monsoon: | 83 if not monsoon: |
84 return False | 84 return False |
85 try: | 85 try: |
86 monsoon.Monsoon(wait=False) | 86 monsoon.Monsoon(wait=False) |
87 except IOError: | 87 except IOError: |
88 return False | 88 return False |
89 else: | 89 else: |
90 return True | 90 return True |
91 | 91 |
92 def CollectProfile(self): | 92 def CollectProfile(self): |
93 self._is_collecting.clear() | 93 self._is_collecting.clear() |
94 self._collector.join() | 94 self._collector.join() |
95 return [self._output_path] | 95 return [self._output_path] |
OLD | NEW |