Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_PERFORMANCE_MONITOR_UTIL_H_ | 5 #ifndef CHROME_BROWSER_PERFORMANCE_MONITOR_UTIL_H_ |
| 6 #define CHROME_BROWSER_PERFORMANCE_MONITOR_UTIL_H_ | 6 #define CHROME_BROWSER_PERFORMANCE_MONITOR_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/threading/sequenced_worker_pool.h" | |
| 8 #include "base/time.h" | 9 #include "base/time.h" |
| 9 #include "chrome/browser/performance_monitor/event.h" | 10 #include "chrome/browser/performance_monitor/event.h" |
| 10 #include "chrome/browser/performance_monitor/metric_info.h" | 11 #include "chrome/browser/performance_monitor/metric_info.h" |
| 11 #include "chrome/common/extensions/extension_constants.h" | 12 #include "chrome/common/extensions/extension_constants.h" |
| 12 | 13 |
| 13 namespace performance_monitor { | 14 namespace performance_monitor { |
| 14 namespace util { | 15 namespace util { |
| 15 | 16 |
| 16 // Metric data can be either dense or sporadic, so AggregateMetric() normalizes | 17 // Metric data can be either dense or sporadic, so AggregateMetric() normalizes |
| 17 // the metric data in time. |metric_infos| must be sorted in increasing time. | 18 // the metric data in time. |metric_infos| must be sorted in increasing time. |
| 18 // Put concisely, AggregateMetric() does sample rate conversion from irregular | 19 // Put concisely, AggregateMetric() does sample rate conversion from irregular |
| 19 // metric data points to a sample period of |resolution| beginning at |start|. | 20 // metric data points to a sample period of |resolution| beginning at |start|. |
| 20 // Each sampling window starts and ends at an integer multiple away from | 21 // Each sampling window starts and ends at an integer multiple away from |
| 21 // |start| and data points are omitted if there are no points to resample. | 22 // |start| and data points are omitted if there are no points to resample. |
| 22 std::vector<MetricInfo> AggregateMetric( | 23 std::vector<MetricInfo> AggregateMetric( |
| 23 const std::vector<MetricInfo>& metric_infos, | 24 const std::vector<MetricInfo>& metric_infos, |
| 24 const base::Time& start, | 25 const base::Time& start, |
| 25 const base::TimeDelta& resolution); | 26 const base::TimeDelta& resolution); |
| 26 | 27 |
| 28 bool PostTaskToDatabaseAndReply(const base::Closure& request, | |
|
Evan Stade
2012/07/10 07:59:39
docs. Also you're not really posting to a database
Matt Tytel
2012/07/10 19:08:19
Done.
| |
| 29 const base::Closure& reply); | |
| 30 | |
| 27 // These are a collection of methods designed to create an event to store the | 31 // These are a collection of methods designed to create an event to store the |
| 28 // pertinent information, given all the fields. Please use these methods to | 32 // pertinent information, given all the fields. Please use these methods to |
| 29 // create any PerformanceMonitor events, as this will ensure strong-typing | 33 // create any PerformanceMonitor events, as this will ensure strong-typing |
| 30 // guards that performance_monitor::Event() will not. | 34 // guards that performance_monitor::Event() will not. |
| 31 scoped_ptr<Event> CreateExtensionInstallEvent( | 35 scoped_ptr<Event> CreateExtensionInstallEvent( |
| 32 const base::Time& time, | 36 const base::Time& time, |
| 33 const std::string& id, | 37 const std::string& id, |
| 34 const std::string& name, | 38 const std::string& name, |
| 35 const std::string& url, | 39 const std::string& url, |
| 36 const int& location, | 40 const int& location, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 | 91 |
| 88 scoped_ptr<Event> CreateChromeUpdateEvent( | 92 scoped_ptr<Event> CreateChromeUpdateEvent( |
| 89 const base::Time& time, | 93 const base::Time& time, |
| 90 const std::string& previous_version, | 94 const std::string& previous_version, |
| 91 const std::string& current_version); | 95 const std::string& current_version); |
| 92 | 96 |
| 93 } // namespace util | 97 } // namespace util |
| 94 } // namespace performance_monitor | 98 } // namespace performance_monitor |
| 95 | 99 |
| 96 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_UTIL_H__ | 100 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_UTIL_H__ |
| OLD | NEW |