[email protected] | 7f07db6 | 2014-05-15 01:12:45 | [diff] [blame] | 1 | // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "components/metrics/metrics_pref_names.h" |
| 6 | |
| 7 | namespace metrics { |
| 8 | namespace prefs { |
| 9 | |
[email protected] | 6580145 | 2014-07-09 05:42:41 | [diff] [blame] | 10 | // Set once, to the current epoch time, on the first run of chrome on this |
| 11 | // machine. Attached to metrics reports forever thereafter. |
Robert Kaplow | abb24ba0 | 2020-11-17 17:39:50 | [diff] [blame] | 12 | // Note: the 'uninstall_metrics' name is a legacy name and doesn't mean much. |
[email protected] | 6580145 | 2014-07-09 05:42:41 | [diff] [blame] | 13 | const char kInstallDate[] = "uninstall_metrics.installation_date2"; |
| 14 | |
[email protected] | 16a3091 | 2014-06-04 00:20:04 | [diff] [blame] | 15 | // The metrics client GUID. |
| 16 | // Note: The name client_id2 is a result of creating |
| 17 | // new prefs to do a one-time reset of the previous values. |
| 18 | const char kMetricsClientID[] = "user_experience_metrics.client_id2"; |
| 19 | |
gayane | 06e66ef3 | 2016-06-06 20:39:14 | [diff] [blame] | 20 | // An enum value indicating the default value of the enable metrics reporting |
| 21 | // checkbox shown during first-run. If it's opt-in, then the checkbox defaulted |
| 22 | // to unchecked, if it's opt-out, then it defaulted to checked. This value is |
| 23 | // only recorded during first-run, so older clients will not set it. The enum |
| 24 | // used for the value is metrics::MetricsServiceClient::EnableMetricsDefault. |
| 25 | const char kMetricsDefaultOptIn[] = "user_experience_metrics.default_opt_in"; |
| 26 | |
gayane | 8b523b87 | 2016-09-30 21:43:59 | [diff] [blame] | 27 | // Array of dictionaries that are each UMA logs that were supposed to be sent in |
| 28 | // the first minute of a browser session. These logs include things like crash |
| 29 | // count info, etc. |
| 30 | const char kMetricsInitialLogs[] = "user_experience_metrics.initial_logs2"; |
[email protected] | 7f07db6 | 2014-05-15 01:12:45 | [diff] [blame] | 31 | |
Tao Bai | afdf8dfd40 | 2020-06-06 03:38:01 | [diff] [blame] | 32 | // An dictionary of information about the unsent initial logs, it was |
| 33 | // recorded when the unsent log is persisted and will be written into the |
| 34 | // metrics at the next browser starts up. |
| 35 | const char kMetricsInitialLogsMetadata[] = |
| 36 | "user_experience_metrics.unsent_log_metadata.initial_logs"; |
| 37 | |
Paul Miller | 4355667 | 2018-12-19 07:12:58 | [diff] [blame] | 38 | // Low entropy source values. The new source (with suffix "3") was created |
| 39 | // because the old source (with suffix "2") is biased in the wild. Clients which |
| 40 | // have an old source still incorporate it into the high entropy source, to |
| 41 | // avoid reshuffling experiments using high entropy, but use the new source for |
| 42 | // experiments requiring low entropy. Newer clients only have the new source, |
| 43 | // and use it both for low entropy experiments to to incorporate into the high |
Jon Azose | 0dc5353 | 2021-04-01 18:38:18 | [diff] [blame] | 44 | // entropy source for high entropy experiments. The pseudo low entropy source |
| 45 | // is not used for trial assignment, but only for statistical validation. It |
| 46 | // should be assigned in the same way as the new source (with suffix "3"). |
[email protected] | 16a3091 | 2014-06-04 00:20:04 | [diff] [blame] | 47 | const char kMetricsLowEntropySource[] = |
Paul Miller | 4355667 | 2018-12-19 07:12:58 | [diff] [blame] | 48 | "user_experience_metrics.low_entropy_source3"; |
| 49 | const char kMetricsOldLowEntropySource[] = |
[email protected] | 16a3091 | 2014-06-04 00:20:04 | [diff] [blame] | 50 | "user_experience_metrics.low_entropy_source2"; |
Jon Azose | 0dc5353 | 2021-04-01 18:38:18 | [diff] [blame] | 51 | const char kMetricsPseudoLowEntropySource[] = |
| 52 | "user_experience_metrics.pseudo_low_entropy_source"; |
[email protected] | 16a3091 | 2014-06-04 00:20:04 | [diff] [blame] | 53 | |
[email protected] | 66d176a | 2014-05-22 13:49:39 | [diff] [blame] | 54 | // A machine ID used to detect when underlying hardware changes. It is only |
| 55 | // stored locally and never transmitted in metrics reports. |
| 56 | const char kMetricsMachineId[] = "user_experience_metrics.machine_id"; |
| 57 | |
gayane | 8b523b87 | 2016-09-30 21:43:59 | [diff] [blame] | 58 | // Array of dictionaries that are each UMA logs that were not sent because the |
| 59 | // browser terminated before these accumulated metrics could be sent. These |
[email protected] | 7f07db6 | 2014-05-15 01:12:45 | [diff] [blame] | 60 | // logs typically include histograms and memory reports, as well as ongoing |
| 61 | // user activities. |
gayane | 8b523b87 | 2016-09-30 21:43:59 | [diff] [blame] | 62 | const char kMetricsOngoingLogs[] = "user_experience_metrics.ongoing_logs2"; |
[email protected] | 7f07db6 | 2014-05-15 01:12:45 | [diff] [blame] | 63 | |
Tao Bai | afdf8dfd40 | 2020-06-06 03:38:01 | [diff] [blame] | 64 | // An dictionary that is same as kUnsentLogMetkMetricsInitialLogsMetadata, |
| 65 | // but for the ongoing logs. |
| 66 | const char kMetricsOngoingLogsMetadata[] = |
| 67 | "user_experience_metrics.unsent_log_metadata.ongoing_logs"; |
| 68 | |
[email protected] | 66d176a | 2014-05-22 13:49:39 | [diff] [blame] | 69 | // Boolean that indicates a cloned install has been detected and the metrics |
| 70 | // client id and low entropy source should be reset. |
| 71 | const char kMetricsResetIds[] = "user_experience_metrics.reset_metrics_ids"; |
| 72 | |
blundell | 6e85b7c | 2015-09-29 12:33:35 | [diff] [blame] | 73 | // Boolean that specifies whether or not crash reporting and metrics reporting |
| 74 | // are sent over the network for analysis. |
| 75 | const char kMetricsReportingEnabled[] = |
| 76 | "user_experience_metrics.reporting_enabled"; |
| 77 | |
asvitkine | 2b53ee0 | 2016-08-15 17:36:24 | [diff] [blame] | 78 | // Date/time when the user opted in to UMA and generated the client id most |
| 79 | // recently (local machine time, stored as a 64-bit time_t value). |
[email protected] | 16a3091 | 2014-06-04 00:20:04 | [diff] [blame] | 80 | const char kMetricsReportingEnabledTimestamp[] = |
| 81 | "user_experience_metrics.client_id_timestamp"; |
| 82 | |
| 83 | // The metrics client session ID. |
| 84 | const char kMetricsSessionID[] = "user_experience_metrics.session_id"; |
| 85 | |
bcwhite | 34c6bbf | 2016-02-19 22:14:46 | [diff] [blame] | 86 | // The prefix of the last-seen timestamp for persistent histogram files. |
| 87 | // Values are named for the files themselves. |
Jonghyun Ahn | 550d879 | 2021-11-08 18:40:41 | [diff] [blame] | 88 | const char kMetricsLastSeenPrefix[] = "user_experience_metrics.last_seen."; |
bcwhite | 34c6bbf | 2016-02-19 22:14:46 | [diff] [blame] | 89 | |
Michael Bai | b9b9a7c | 2020-08-24 22:04:05 | [diff] [blame] | 90 | // Array of the number of samples in the memory mapped file. |
| 91 | const char kMetricsFileMetricsMetadata[] = |
| 92 | "user_experience_metrics.file_metrics_metadata"; |
| 93 | |
Weilun Shi | f98b41a | 2021-08-11 07:53:02 | [diff] [blame] | 94 | // The number of times the client has been reset due to cloned install. |
| 95 | const char kClonedResetCount[] = "cloned_install.count"; |
| 96 | |
| 97 | // The first timestamp when we reset a cloned client’s client id. This is only |
| 98 | // set once. Attached to metrics reports forever thereafter. |
| 99 | const char kFirstClonedResetTimestamp[] = "cloned_install.first_timestamp"; |
| 100 | |
| 101 | // The last timestamp the client is reset due to cloned install. This will be |
| 102 | // updated every time we reset the client due to cloned install. |
| 103 | const char kLastClonedResetTimestamp[] = "cloned_install.last_timestamp"; |
[email protected] | 91b1d91 | 2014-06-05 10:52:08 | [diff] [blame] | 104 | |
Sigurdur Asgeirsson | 5795250 | 2018-01-29 16:15:08 | [diff] [blame] | 105 | // A time stamp at which time the browser was known to be alive. Used to |
| 106 | // evaluate whether the browser crash was due to a whole system crash. |
| 107 | // At minimum this is updated each time the "exited_cleanly" preference is |
| 108 | // modified, but can also be optionally updated on a slow schedule. |
| 109 | const char kStabilityBrowserLastLiveTimeStamp[] = |
| 110 | "user_experience_metrics.stability.browser_last_live_timestamp"; |
| 111 | |
[email protected] | 91b1d91 | 2014-06-05 10:52:08 | [diff] [blame] | 112 | // Number of times the application exited uncleanly since the last report. |
Peter Wen | 45025ea | 2018-09-17 15:16:27 | [diff] [blame] | 113 | // On Android this does not count the ones due to Gms Core updates (below). |
[email protected] | 91b1d91 | 2014-06-05 10:52:08 | [diff] [blame] | 114 | const char kStabilityCrashCount[] = |
| 115 | "user_experience_metrics.stability.crash_count"; |
| 116 | |
Ran Ji | 988b5be | 2018-01-17 19:24:50 | [diff] [blame] | 117 | // Number of times the application exited uncleanly since the last report |
Peter Wen | 45025ea | 2018-09-17 15:16:27 | [diff] [blame] | 118 | // due to a gms core update. |
| 119 | const char kStabilityCrashCountDueToGmsCoreUpdate[] = |
| 120 | "user_experience_metrics.stability.crash_count_due_to_gms_core_update"; |
| 121 | |
[email protected] | d6147bd | 2014-06-11 01:58:19 | [diff] [blame] | 122 | // True if the previous run of the program exited cleanly. |
| 123 | const char kStabilityExitedCleanly[] = |
| 124 | "user_experience_metrics.stability.exited_cleanly"; |
| 125 | |
blundell | 8ae1562 | 2015-09-28 08:34:16 | [diff] [blame] | 126 | // Number of times an extension renderer process crashed since the last report. |
| 127 | const char kStabilityExtensionRendererCrashCount[] = |
| 128 | "user_experience_metrics.stability.extension_renderer_crash_count"; |
| 129 | |
Michael Bai | b9b9a7c | 2020-08-24 22:04:05 | [diff] [blame] | 130 | // The total number of samples that will be lost if ASSOCIATE_INTERNAL_PROFILE |
| 131 | // isn't enabled since the previous stability recorded, this is different than |
| 132 | // the previous browser run, because one file was just uploaded before the |
| 133 | // stability is recorded. |
| 134 | const char kStabilityFileMetricsUnsentSamplesCount[] = |
| 135 | "user_experience_metrics.stability.file_metrics_unsent_samples_count"; |
| 136 | |
| 137 | // The number of the unsent files at the time the stability recorded. |
| 138 | const char kStabilityFileMetricsUnsentFilesCount[] = |
| 139 | "user_experience_metrics.stability.file_metrics_unsent_files_count"; |
| 140 | |
Ran Ji | 988b5be | 2018-01-17 19:24:50 | [diff] [blame] | 141 | // The GMS core version used in Chrome. |
| 142 | const char kStabilityGmsCoreVersion[] = |
| 143 | "user_experience_metrics.stability.gms_core_version"; |
| 144 | |
Peter Wen | d52718f | 2018-09-18 05:38:28 | [diff] [blame] | 145 | // Number of times a gpu process crashed since the last report. Currently only |
| 146 | // recorded on Android. |
| 147 | const char kStabilityGpuCrashCount[] = |
| 148 | "user_experience_metrics.stability.gpu_crash_count"; |
| 149 | |
Caitlin Fischer | 92fb62d | 2022-03-28 15:43:28 | [diff] [blame] | 150 | #if BUILDFLAG(IS_ANDROID) |
Caitlin Fischer | e321b45 | 2022-04-25 20:29:22 | [diff] [blame] | 151 | // Number of times the application was launched since last report. Used on |
| 152 | // Android platforms as WebView may still be interested in this metric. |
[email protected] | 91b1d91 | 2014-06-05 10:52:08 | [diff] [blame] | 153 | const char kStabilityLaunchCount[] = |
| 154 | "user_experience_metrics.stability.launch_count"; |
Caitlin Fischer | e321b45 | 2022-04-25 20:29:22 | [diff] [blame] | 155 | |
| 156 | // Number of times a renderer process successfully launched since the last |
| 157 | // report. Used on Android platforms as WebView may still be interested in this |
| 158 | // metric. |
| 159 | const char kStabilityRendererLaunchCount[] = |
| 160 | "user_experience_metrics.stability.renderer_launch_count"; |
Caitlin Fischer | 92fb62d | 2022-03-28 15:43:28 | [diff] [blame] | 161 | #endif |
[email protected] | 91b1d91 | 2014-06-05 10:52:08 | [diff] [blame] | 162 | |
blundell | 8ae1562 | 2015-09-28 08:34:16 | [diff] [blame] | 163 | // Number of times a page load event occurred since the last report. |
| 164 | const char kStabilityPageLoadCount[] = |
| 165 | "user_experience_metrics.stability.page_load_count"; |
| 166 | |
| 167 | // Number of times a renderer process crashed since the last report. |
| 168 | const char kStabilityRendererCrashCount[] = |
| 169 | "user_experience_metrics.stability.renderer_crash_count"; |
| 170 | |
[email protected] | 91b1d91 | 2014-06-05 10:52:08 | [diff] [blame] | 171 | // Base64 encoded serialized UMA system profile proto from the previous session. |
| 172 | const char kStabilitySavedSystemProfile[] = |
| 173 | "user_experience_metrics.stability.saved_system_profile"; |
| 174 | |
| 175 | // SHA-1 hash of the serialized UMA system profile proto (hex encoded). |
| 176 | const char kStabilitySavedSystemProfileHash[] = |
| 177 | "user_experience_metrics.stability.saved_system_profile_hash"; |
| 178 | |
[email protected] | d6147bd | 2014-06-11 01:58:19 | [diff] [blame] | 179 | // Build time, in seconds since an epoch, which is used to assure that stability |
| 180 | // metrics reported reflect stability of the same build. |
| 181 | const char kStabilityStatsBuildTime[] = |
| 182 | "user_experience_metrics.stability.stats_buildtime"; |
| 183 | |
| 184 | // Version string of previous run, which is used to assure that stability |
| 185 | // metrics reported under current version reflect stability of the same version. |
| 186 | const char kStabilityStatsVersion[] = |
| 187 | "user_experience_metrics.stability.stats_version"; |
| 188 | |
Sigurdur Asgeirsson | 8c67a59 | 2018-02-02 21:10:33 | [diff] [blame] | 189 | // Number of times the application exited uncleanly and the system session |
| 190 | // embedding the browser session ended abnormally since the last report. |
| 191 | // Windows only. |
| 192 | const char kStabilitySystemCrashCount[] = |
| 193 | "user_experience_metrics.stability.system_crash_count"; |
| 194 | |
holte | 77d815b | 2017-03-27 21:27:37 | [diff] [blame] | 195 | // Dictionary for measuring cellular data used by UKM service during last 7 |
| 196 | // days. |
| 197 | const char kUkmCellDataUse[] = "user_experience_metrics.ukm_cell_datause"; |
| 198 | |
gayane | 0b46091c | 2016-04-07 21:01:05 | [diff] [blame] | 199 | // Dictionary for measuring cellular data used by UMA service during last 7 |
| 200 | // days. |
| 201 | const char kUmaCellDataUse[] = "user_experience_metrics.uma_cell_datause"; |
| 202 | |
| 203 | // Dictionary for measuring cellular data used by user including chrome services |
| 204 | // per day. |
| 205 | const char kUserCellDataUse[] = "user_experience_metrics.user_call_datause"; |
| 206 | |
Jonghyun Ahn | 550d879 | 2021-11-08 18:40:41 | [diff] [blame] | 207 | // String for holding user ID associated with the current ongoing UMA |
| 208 | // log. This pref will be used to determine whether to send metrics in case |
| 209 | // of a crash. |
| 210 | const char kMetricsCurrentUserId[] = "metrics.current_user_id"; |
| 211 | |
[email protected] | 7f07db6 | 2014-05-15 01:12:45 | [diff] [blame] | 212 | } // namespace prefs |
| 213 | } // namespace metrics |