| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 """Parser and evaluator for performance tests. | 5 """Parser and evaluator for performance tests. |
| 6 | 6 |
| 7 Several performance tests have complicated log output, this module is intended | 7 Several performance tests have complicated log output, this module is intended |
| 8 to help buildsteps parse these logs and identify if tests had anomalies. | 8 to help buildsteps parse these logs and identify if tests had anomalies. |
| 9 | 9 |
| 10 | 10 |
| (...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1024 chromium_utils.GetParentClass(self).ProcessLine(self, line) | 1024 chromium_utils.GetParentClass(self).ProcessLine(self, line) |
| 1025 | 1025 |
| 1026 def _CalculateStatistics(self, value_list, trace_name): | 1026 def _CalculateStatistics(self, value_list, trace_name): |
| 1027 """Handles statistics generation and recording for page-cycler data. | 1027 """Handles statistics generation and recording for page-cycler data. |
| 1028 | 1028 |
| 1029 Sums the timings over all pages for each iteration and returns a tuple | 1029 Sums the timings over all pages for each iteration and returns a tuple |
| 1030 (mean, standard deviation) of those sums. Also saves a data file | 1030 (mean, standard deviation) of those sums. Also saves a data file |
| 1031 <revision>_<tracename>.dat holding a line of times for each URL loaded, | 1031 <revision>_<tracename>.dat holding a line of times for each URL loaded, |
| 1032 for use by humans when debugging a regression. | 1032 for use by humans when debugging a regression. |
| 1033 """ | 1033 """ |
| 1034 |
| 1035 # If the name of the trace is one of the pages in the page list then we are |
| 1036 # dealing with the results for that page only, not the overall results. So |
| 1037 # calculate the statistics like a normal GraphingLogProcessor, not the |
| 1038 # GraphingPageCyclerLogProcessor. |
| 1039 if trace_name in self._page_list: |
| 1040 return super(GraphingPageCyclerLogProcessor, self)._CalculateStatistics( |
| 1041 value_list, trace_name) |
| 1042 |
| 1034 sums = [] | 1043 sums = [] |
| 1035 page_times = {} | 1044 page_times = {} |
| 1036 page_count = len(self._page_list) | 1045 page_count = len(self._page_list) |
| 1037 | 1046 |
| 1038 iteration_count = len(value_list) / page_count | 1047 iteration_count = len(value_list) / page_count |
| 1039 for iteration in range(iteration_count): | 1048 for iteration in range(iteration_count): |
| 1040 start = page_count * iteration | 1049 start = page_count * iteration |
| 1041 end = start + page_count | 1050 end = start + page_count |
| 1042 iteration_times = value_list[start:end] | 1051 iteration_times = value_list[start:end] |
| 1043 sums += [sum(iteration_times)] | 1052 sums += [sum(iteration_times)] |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1061 for page in self._page_list: | 1070 for page in self._page_list: |
| 1062 times = page_times[page] | 1071 times = page_times[page] |
| 1063 mean, stddev = chromium_utils.FilteredMeanAndStandardDeviation(times) | 1072 mean, stddev = chromium_utils.FilteredMeanAndStandardDeviation(times) |
| 1064 file_data.append('%s (%s+/-%s): %s' % (page, | 1073 file_data.append('%s (%s+/-%s): %s' % (page, |
| 1065 FormatFloat(mean), | 1074 FormatFloat(mean), |
| 1066 FormatFloat(stddev), | 1075 FormatFloat(stddev), |
| 1067 JoinWithSpacesAndNewLine(times))) | 1076 JoinWithSpacesAndNewLine(times))) |
| 1068 | 1077 |
| 1069 filename = '%s_%s.dat' % (self._revision, trace_name) | 1078 filename = '%s_%s.dat' % (self._revision, trace_name) |
| 1070 return {filename: file_data} | 1079 return {filename: file_data} |
| OLD | NEW |