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

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

Issue 81603002: Send UMA stability stats in a separate UMA log on startup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years 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
« no previous file with comments | « no previous file | chrome/browser/metrics/metrics_service.cc » ('j') | chrome/browser/metrics/metrics_service.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/metrics_service.h
===================================================================
--- chrome/browser/metrics/metrics_service.h (revision 238706)
+++ chrome/browser/metrics/metrics_service.h (working copy)
@@ -114,6 +114,13 @@
MetricsService();
virtual ~MetricsService();
+ // Initializes metrics recording state. Updates various bookkeeping values in
+ // prefs and sets up the scheduler. This is a separate function rather than
+ // being done by the constructor so that field trials could be created before
+ // this is run. Takes |reporting_will_be_enabled| parameter which specifies
+ // whether UMA is enabled.
+ void InitializeMetricsRecordingState(bool reporting_will_be_enabled);
Ilya Sherman 2013/12/06 06:21:26 nit: Please define an enum to use in place of the
Ilya Sherman 2013/12/06 06:21:26 Why is this method public? It doesn't look like y
Alexei Svitkine (slow) 2013/12/06 17:59:22 Yes, that was my mistake - I forgot to include the
Alexei Svitkine (slow) 2013/12/06 17:59:22 Done.
+
// Starts the metrics system, turning on recording and uploading of metrics.
// Should be called when starting up with metrics enabled, or when metrics
// are turned on.
@@ -253,12 +260,13 @@
// The MetricsService has a lifecycle that is stored as a state.
// See metrics_service.cc for description of this lifecycle.
enum State {
- INITIALIZED, // Constructor was called.
- INIT_TASK_SCHEDULED, // Waiting for deferred init tasks to complete.
- INIT_TASK_DONE, // Waiting for timer to send initial log.
- INITIAL_LOG_READY, // Initial log generated, and waiting for reply.
- SENDING_OLD_LOGS, // Sending unsent logs from previous session.
- SENDING_CURRENT_LOGS, // Sending standard current logs as they acrue.
+ INITIALIZED, // Constructor was called.
+ INIT_TASK_SCHEDULED, // Waiting for deferred init task to finish.
Ilya Sherman 2013/12/06 06:21:26 nit: "tasks" seems more accurate, since this can b
Alexei Svitkine (slow) 2013/12/06 17:59:22 Unfortunately, it goes above the 80 col limit (if
Ilya Sherman 2013/12/07 06:51:53 You can wrap the line like so: INIT_TASK_SCHE
Alexei Svitkine (slow) 2013/12/09 21:17:02 Done.
+ INIT_TASK_DONE, // Waiting for timer to send initial log.
+ SENDING_INITIAL_STABILITY_LOG, // Initial stability log being sent.
+ SENDING_INITIAL_METRICS_LOG, // Initial metrics log being sent.
Ilya Sherman 2013/12/06 06:21:26 Jim made a good point in a previous discussion tha
Alexei Svitkine (slow) 2013/12/06 17:59:22 The code already treats it as an ongoing log (sema
Ilya Sherman 2013/12/07 06:51:53 Ok.
+ SENDING_OLD_LOGS, // Sending unsent logs from last session.
+ SENDING_CURRENT_LOGS, // Sending ongoing logs as they accrue.
};
enum ShutdownCleanliness {
@@ -349,7 +357,7 @@
void HandleIdleSinceLastTransmission(bool in_idle);
// Set up client ID, session ID, etc.
- void InitializeMetricsState();
+ void InitializeMetricsState(bool reporting_will_be_enabled);
// Generates a new client ID to use to identify self to metrics server.
static std::string GenerateClientID();
@@ -393,9 +401,14 @@
// (depending on |state_|), and stages it for upload.
void StageNewLog();
- // Record stats, client ID, Session ID, etc. in a special "first" log.
- void PrepareInitialLog();
+ // Prepares the initial stability log, based on the saved system profile from
+ // a previous session and metrics stability stats and stages it for upload.
Ilya Sherman 2013/12/06 06:21:26 nit: "and metrics stability stats" -> rephrase som
Alexei Svitkine (slow) 2013/12/06 17:59:22 Done.
+ void PrepareInitialStabilityLog();
+ // Prepares the initial metrics log, which includes startup histograms and
+ // profiler data, as well as incremental stability-related metrics.
+ void PrepareInitialMetricsLog(MetricsLog::LogType log_type);
+
// Uploads the currently staged log (which must be non-null).
void SendStagedLog();
@@ -487,8 +500,10 @@
// Google Update statistics, which were retrieved on a blocking pool thread.
GoogleUpdateMetrics google_update_metrics_;
- // The initial log, used to record startup metrics.
- scoped_ptr<MetricsLog> initial_log_;
+ // The initial metrics log, used to record startup metrics (histograms and
+ // profiler data). Note that if a crash occurred in the previous session, an
+ // initial stability log may be sent before this.
+ scoped_ptr<MetricsLog> initial_metrics_log_;
// The outstanding transmission appears as a URL Fetch operation.
scoped_ptr<net::URLFetcher> current_fetch_;
« no previous file with comments | « no previous file | chrome/browser/metrics/metrics_service.cc » ('j') | chrome/browser/metrics/metrics_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698