Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: chrome/browser/performance_monitor/performance_monitor_util.h

Issue 10860017: Refactor Metrics (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/callback.h" 8 #include "base/callback.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "base/tracked_objects.h" 10 #include "base/tracked_objects.h"
11 #include "chrome/browser/performance_monitor/event.h" 11 #include "chrome/browser/performance_monitor/event.h"
12 #include "chrome/browser/performance_monitor/metric_info.h" 12 #include "chrome/browser/performance_monitor/metric.h"
13 #include "chrome/common/extensions/extension_constants.h" 13 #include "chrome/common/extensions/extension_constants.h"
14 14
15 namespace performance_monitor { 15 namespace performance_monitor {
16 namespace util { 16 namespace util {
17 17
18 // Metric data can be either dense or sporadic, so AggregateMetric() normalizes 18 // Metric data can be either dense or sporadic, so AggregateMetric() normalizes
19 // the metric data in time. |metric_infos| must be sorted in increasing time. 19 // the metric data in time. |metric_infos| must be sorted in increasing time.
20 // Put concisely, AggregateMetric() does sample rate conversion from irregular 20 // Put concisely, AggregateMetric() does sample rate conversion from irregular
21 // metric data points to a sample period of |resolution| beginning at |start|. 21 // metric data points to a sample period of |resolution| beginning at |start|.
22 // Each sampling window starts and ends at an integer multiple away from 22 // Each sampling window starts and ends at an integer multiple away from
23 // |start| and data points are omitted if there are no points to resample. 23 // |start| and data points are omitted if there are no points to resample.
24 std::vector<MetricInfo> AggregateMetric( 24 std::vector<Metric> AggregateMetric(const std::vector<Metric>& metrics,
25 const std::vector<MetricInfo>& metric_infos, 25 const base::Time& start,
26 const base::Time& start, 26 const base::TimeDelta& resolution);
27 const base::TimeDelta& resolution);
28 27
29 // Posts |request| to the performance monitor database's sequenced thread. On 28 // Posts |request| to the performance monitor database's sequenced thread. On
30 // completion |reply| is posted to the thread that called 29 // completion |reply| is posted to the thread that called
31 // PostTaskToDatabaseThreadAndReply. 30 // PostTaskToDatabaseThreadAndReply.
32 bool PostTaskToDatabaseThreadAndReply( 31 bool PostTaskToDatabaseThreadAndReply(
33 const tracked_objects::Location& from_here, 32 const tracked_objects::Location& from_here,
34 const base::Closure& request, 33 const base::Closure& request,
35 const base::Closure& reply); 34 const base::Closure& reply);
36 35
37 // These are a collection of methods designed to create an event to store the 36 // These are a collection of methods designed to create an event to store the
(...skipping 19 matching lines...) Expand all
57 const std::string& profile_name); 56 const std::string& profile_name);
58 57
59 scoped_ptr<Event> CreateChromeUpdateEvent(const base::Time& time, 58 scoped_ptr<Event> CreateChromeUpdateEvent(const base::Time& time,
60 const std::string& previous_version, 59 const std::string& previous_version,
61 const std::string& current_version); 60 const std::string& current_version);
62 61
63 } // namespace util 62 } // namespace util
64 } // namespace performance_monitor 63 } // namespace performance_monitor
65 64
66 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_UTIL_H__ 65 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_UTIL_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698