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

Unified Diff: chrome/browser/metrics/perf_provider_chromeos.h

Issue 282093011: metrics: Use absolute interval-based perf collection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/metrics/perf_provider_chromeos.h
diff --git a/chrome/browser/metrics/perf_provider_chromeos.h b/chrome/browser/metrics/perf_provider_chromeos.h
index 28227107830e6215be58cb763456962a3172550b..91f07a2af795338e90636cb8b461ccd001e6a72e 100644
--- a/chrome/browser/metrics/perf_provider_chromeos.h
+++ b/chrome/browser/metrics/perf_provider_chromeos.h
@@ -12,7 +12,7 @@
#include "base/threading/non_thread_safe.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
-#include "components/metrics/proto/perf_data.pb.h"
+#include "components/metrics/proto/sampled_profile.pb.h"
namespace metrics {
@@ -28,12 +28,13 @@ class PerfProvider : public base::NonThreadSafe {
// Writes collected perf data protobufs to |perf_data|. Clears all the stored
// perf data. Returns true if it wrote to |perf_data|.
- bool GetPerfData(std::vector<PerfDataProto>* perf_data);
+ bool GetPerfData(std::vector<SampledProfile>* perf_data);
private:
// Starts an internal timer to start collecting perf data. The timer is set to
- // trigger |interval| after this function call.
- void ScheduleCollection(const base::TimeDelta& interval);
+ // trigger at a random point in either the current or the next profiling
+ // interval.
+ void ScheduleCollection();
// Collects perf data if it has not been consumed by calling GetPerfData()
// (see above).
@@ -50,8 +51,8 @@ class PerfProvider : public base::NonThreadSafe {
scoped_ptr<WindowedIncognitoObserver> incognito_observer,
const std::vector<uint8>& data);
- // Vector of perf data protobufs.
- std::vector<PerfDataProto> cached_perf_data_;
+ // Vector of SampledProfile protobufs containing perf profiles.
+ std::vector<SampledProfile> cached_perf_data_;
// For scheduling collection of perf data.
base::OneShotTimer<PerfProvider> timer_;
@@ -59,6 +60,9 @@ class PerfProvider : public base::NonThreadSafe {
// To pass around the "this" pointer across threads safely.
base::WeakPtrFactory<PerfProvider> weak_factory_;
+ // Record of the last login time.
+ base::Time login_time_;
Ilya Sherman 2014/05/16 21:48:57 Did you mean TimeTicks?
Simon Que 2014/05/17 03:25:07 Done.
+
DISALLOW_COPY_AND_ASSIGN(PerfProvider);
};

Powered by Google App Engine
This is Rietveld 408576698