| 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_DATABASE_H_ | 5 #ifndef CHROME_BROWSER_PERFORMANCE_MONITOR_DATABASE_H_ |
| 6 #define CHROME_BROWSER_PERFORMANCE_MONITOR_DATABASE_H_ | 6 #define CHROME_BROWSER_PERFORMANCE_MONITOR_DATABASE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 // Get the metrics that are active for the given process between |start| | 152 // Get the metrics that are active for the given process between |start| |
| 153 // (inclusive) and |end| (exclusive). | 153 // (inclusive) and |end| (exclusive). |
| 154 std::vector<const MetricDetails*> GetActiveMetrics(const base::Time& start, | 154 std::vector<const MetricDetails*> GetActiveMetrics(const base::Time& start, |
| 155 const base::Time& end); | 155 const base::Time& end); |
| 156 | 156 |
| 157 // Get the activities that are active for the given metric after |start|. | 157 // Get the activities that are active for the given metric after |start|. |
| 158 std::vector<std::string> GetActiveActivities(MetricType metric_type, | 158 std::vector<std::string> GetActiveActivities(MetricType metric_type, |
| 159 const base::Time& start); | 159 const base::Time& start); |
| 160 | 160 |
| 161 // Populate info with the most recent activity. Return false if populate |
| 162 // was unsuccessful. |
| 163 bool GetRecentStatsForActivityAndMetric(const std::string& activity, |
| 164 MetricType metric, |
| 165 MetricInfo* info); |
| 166 |
| 167 bool GetRecentStatsForActivityAndMetric(MetricType metric, MetricInfo* info) { |
| 168 return GetRecentStatsForActivityAndMetric(kProcessChromeAggregate, |
| 169 metric, |
| 170 info); |
| 171 } |
| 172 |
| 161 // Query given |metric_type| and |activity|. | 173 // Query given |metric_type| and |activity|. |
| 162 MetricInfoVector GetStatsForActivityAndMetric(const std::string& activity, | 174 MetricInfoVector GetStatsForActivityAndMetric(const std::string& activity, |
| 163 MetricType metric_type, | 175 MetricType metric_type, |
| 164 const base::Time& start, | 176 const base::Time& start, |
| 165 const base::Time& end); | 177 const base::Time& end); |
| 166 | 178 |
| 167 MetricInfoVector GetStatsForActivityAndMetric(MetricType metric_type, | 179 MetricInfoVector GetStatsForActivityAndMetric(MetricType metric_type, |
| 168 const base::Time& start, | 180 const base::Time& start, |
| 169 const base::Time& end) { | 181 const base::Time& end) { |
| 170 return GetStatsForActivityAndMetric(kProcessChromeAggregate, metric_type, | 182 return GetStatsForActivityAndMetric(kProcessChromeAggregate, metric_type, |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 269 |
| 258 leveldb::ReadOptions read_options_; | 270 leveldb::ReadOptions read_options_; |
| 259 leveldb::WriteOptions write_options_; | 271 leveldb::WriteOptions write_options_; |
| 260 | 272 |
| 261 DISALLOW_COPY_AND_ASSIGN(Database); | 273 DISALLOW_COPY_AND_ASSIGN(Database); |
| 262 }; | 274 }; |
| 263 | 275 |
| 264 } // namespace performance_monitor | 276 } // namespace performance_monitor |
| 265 | 277 |
| 266 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_DATABASE_H_ | 278 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_DATABASE_H_ |
| OLD | NEW |