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

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

Issue 364913007: metrics: Add random delays to perf collection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 8f1ac2f830a0bef4d3fdb0055923a91ae695cc94..a149bf2f7d9c23e123737163e7104b58e5858984 100644
--- a/chrome/browser/metrics/perf_provider_chromeos.h
+++ b/chrome/browser/metrics/perf_provider_chromeos.h
@@ -85,6 +85,16 @@ class PerfProvider : public base::NonThreadSafe,
// reschedules it to be collected again.
void DoPeriodicCollection();
+ // Collects perf data after a resume. |sleep_duration_ms| is the duration the
Ilya Sherman 2014/07/03 00:12:48 nit: Perhaps name the variable "suspend_duration",
Simon Que 2014/07/07 19:45:26 Done.
+ // system was suspended before resuming. |time_after_resume_ms| is how long
+ // ago the system resumed.
+ void DoResumeCollection(uint64 sleep_duration_ms,
Ilya Sherman 2014/07/03 00:12:48 nit: Perhaps something more like "CollectPerfDataA
Simon Que 2014/07/07 19:45:26 Done.
+ uint64 time_after_resume_ms);
Ilya Sherman 2014/07/03 00:12:48 Please pass these as TimeDeltas.
Simon Que 2014/07/07 19:45:26 Done.
+
+ // Collects perf data after a session restore. |time_after_restore_ms| is how
+ // long ago the session restore started.
+ void DoRestoreSessionCollection(uint64 time_after_restore_ms);
+
// Parses a perf data protobuf from the |data| passed in only if the
// |incognito_observer| indicates that no incognito window had been opened
// during the profile collection period.
@@ -97,8 +107,14 @@ class PerfProvider : public base::NonThreadSafe,
// Vector of SampledProfile protobufs containing perf profiles.
std::vector<SampledProfile> cached_perf_data_;
- // For scheduling collection of perf data.
- base::OneShotTimer<PerfProvider> timer_;
+ // Timers for scheduling collection of perf data.
+
+ // Timer for interval-based collection.
+ base::OneShotTimer<PerfProvider> interval_timer_;
+ // Timer for collection on resume from suspend.
+ base::OneShotTimer<PerfProvider> resume_timer_;
+ // Timer for collection on restore session.
+ base::OneShotTimer<PerfProvider> restore_session_timer_;
// For detecting when changes to the login state.
LoginObserver login_observer_;
« no previous file with comments | « no previous file | chrome/browser/metrics/perf_provider_chromeos.cc » ('j') | chrome/browser/metrics/perf_provider_chromeos.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698