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 #include "chrome/browser/ui/webui/performance_monitor/performance_monitor_ui_uti
l.h" | 5 #include "chrome/browser/ui/webui/performance_monitor/performance_monitor_ui_uti
l.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "chrome/browser/performance_monitor/metric.h" | 10 #include "chrome/browser/performance_monitor/metric.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 } | 165 } |
166 | 166 |
167 scoped_ptr<VectorOfMetricVectors> AggregateMetric( | 167 scoped_ptr<VectorOfMetricVectors> AggregateMetric( |
168 MetricType type, | 168 MetricType type, |
169 const Database::MetricVector* metrics, | 169 const Database::MetricVector* metrics, |
170 const base::Time& start, | 170 const base::Time& start, |
171 const std::vector<TimeRange>& intervals, | 171 const std::vector<TimeRange>& intervals, |
172 const base::TimeDelta& resolution, | 172 const base::TimeDelta& resolution, |
173 AggregationMethod method) { | 173 AggregationMethod method) { |
174 if (!metrics || intervals.empty()) | 174 if (!metrics || intervals.empty()) |
175 return scoped_ptr<VectorOfMetricVectors>(NULL); | 175 return scoped_ptr<VectorOfMetricVectors>(); |
176 | 176 |
177 CHECK(resolution > base::TimeDelta()); | 177 CHECK(resolution > base::TimeDelta()); |
178 | 178 |
179 switch (method) { | 179 switch (method) { |
180 case AGGREGATION_METHOD_NONE: | 180 case AGGREGATION_METHOD_NONE: |
181 return NoAggregation().AggregateMetrics( | 181 return NoAggregation().AggregateMetrics( |
182 type, metrics, start, intervals, resolution); | 182 type, metrics, start, intervals, resolution); |
183 case AGGREGATION_METHOD_MEDIAN: | 183 case AGGREGATION_METHOD_MEDIAN: |
184 return MedianAggregation().AggregateMetrics( | 184 return MedianAggregation().AggregateMetrics( |
185 type, metrics, start, intervals, resolution); | 185 type, metrics, start, intervals, resolution); |
186 case AGGREGATION_METHOD_MEAN: | 186 case AGGREGATION_METHOD_MEAN: |
187 return MeanAggregation().AggregateMetrics( | 187 return MeanAggregation().AggregateMetrics( |
188 type, metrics, start, intervals, resolution); | 188 type, metrics, start, intervals, resolution); |
189 default: | 189 default: |
190 NOTREACHED(); | 190 NOTREACHED(); |
191 return scoped_ptr<VectorOfMetricVectors>(NULL); | 191 return scoped_ptr<VectorOfMetricVectors>(); |
192 } | 192 } |
193 } | 193 } |
194 | 194 |
195 } // namespace performance_monitor | 195 } // namespace performance_monitor |
OLD | NEW |