metrics_pref_names.cc 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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. #include "components/metrics/metrics_pref_names.h"
  5. namespace metrics {
  6. namespace prefs {
  7. // Set once, to the current epoch time, on the first run of chrome on this
  8. // machine. Attached to metrics reports forever thereafter.
  9. // Note: the 'uninstall_metrics' name is a legacy name and doesn't mean much.
  10. const char kInstallDate[] = "uninstall_metrics.installation_date2";
  11. // A provisional metrics client GUID used for field trial group assignments
  12. // before metrics reporting consent is known (i.e., during first run). This GUID
  13. // is never reported directly. However, if the user enables UMA, this
  14. // provisional client GUID becomes the metrics client GUID (see
  15. // |kMetricsClientID|), and this pref is cleared. In that case, the GUID may
  16. // be reported.
  17. // Note: This GUID is stored in prefs because it is possible that the user
  18. // closes Chrome during the FRE. We re-use this GUID in subsequent FRE runs
  19. // until metrics reporting consent is truly known.
  20. const char kMetricsProvisionalClientID[] =
  21. "user_experience_metrics.provisional_client_id";
  22. // The metrics client GUID.
  23. // Note: The name client_id2 is a result of creating
  24. // new prefs to do a one-time reset of the previous values.
  25. const char kMetricsClientID[] = "user_experience_metrics.client_id2";
  26. // An enum value indicating the default value of the enable metrics reporting
  27. // checkbox shown during first-run. If it's opt-in, then the checkbox defaulted
  28. // to unchecked, if it's opt-out, then it defaulted to checked. This value is
  29. // only recorded during first-run, so older clients will not set it. The enum
  30. // used for the value is metrics::MetricsServiceClient::EnableMetricsDefault.
  31. const char kMetricsDefaultOptIn[] = "user_experience_metrics.default_opt_in";
  32. // Array of dictionaries that are each UMA logs that were supposed to be sent in
  33. // the first minute of a browser session. These logs include things like crash
  34. // count info, etc.
  35. const char kMetricsInitialLogs[] = "user_experience_metrics.initial_logs2";
  36. // An dictionary of information about the unsent initial logs, it was
  37. // recorded when the unsent log is persisted and will be written into the
  38. // metrics at the next browser starts up.
  39. const char kMetricsInitialLogsMetadata[] =
  40. "user_experience_metrics.unsent_log_metadata.initial_logs";
  41. // Low entropy source values. The new source (with suffix "3") was created
  42. // because the old source (with suffix "2") is biased in the wild. Clients which
  43. // have an old source still incorporate it into the high entropy source, to
  44. // avoid reshuffling experiments using high entropy, but use the new source for
  45. // experiments requiring low entropy. Newer clients only have the new source,
  46. // and use it both for low entropy experiments to to incorporate into the high
  47. // entropy source for high entropy experiments. The pseudo low entropy source
  48. // is not used for trial assignment, but only for statistical validation. It
  49. // should be assigned in the same way as the new source (with suffix "3").
  50. const char kMetricsLowEntropySource[] =
  51. "user_experience_metrics.low_entropy_source3";
  52. const char kMetricsOldLowEntropySource[] =
  53. "user_experience_metrics.low_entropy_source2";
  54. const char kMetricsPseudoLowEntropySource[] =
  55. "user_experience_metrics.pseudo_low_entropy_source";
  56. // A machine ID used to detect when underlying hardware changes. It is only
  57. // stored locally and never transmitted in metrics reports.
  58. const char kMetricsMachineId[] = "user_experience_metrics.machine_id";
  59. // Array of dictionaries that are each UMA logs that were not sent because the
  60. // browser terminated before these accumulated metrics could be sent. These
  61. // logs typically include histograms and memory reports, as well as ongoing
  62. // user activities.
  63. const char kMetricsOngoingLogs[] = "user_experience_metrics.ongoing_logs2";
  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. // Boolean that indicates a cloned install has been detected and the metrics
  69. // client id and low entropy source should be reset.
  70. const char kMetricsResetIds[] = "user_experience_metrics.reset_metrics_ids";
  71. #if BUILDFLAG(IS_ANDROID)
  72. // Boolean that determines whether to use the new sampling trial
  73. // "PostFREFixMetricsAndCrashSampling" and feature "PostFREFixMetricsReporting"
  74. // to control sampling on Android Chrome. This is set to true when disabling
  75. // metrics reporting, or on start up if metrics reporting is not consented to
  76. // (including new users going through their first run). As a result, all new UMA
  77. // users should have this pref set to true.
  78. // Note: This exists due to a bug in which the old sampling rate was not being
  79. // applied correctly. In order for the fix to not affect the overall sampling
  80. // rate, this pref controls what trial/feature to use to determine whether the
  81. // client is sampled. See crbug/1306481.
  82. const char kUsePostFREFixSamplingTrial[] =
  83. "user_experience_metrics.use_post_fre_fix_sampling_trial";
  84. #endif // BUILDFLAG(IS_ANDROID)
  85. // Boolean that specifies whether or not crash reporting and metrics reporting
  86. // are sent over the network for analysis.
  87. const char kMetricsReportingEnabled[] =
  88. "user_experience_metrics.reporting_enabled";
  89. // Date/time when the user opted in to UMA and generated the client id most
  90. // recently (local machine time, stored as a 64-bit time_t value).
  91. const char kMetricsReportingEnabledTimestamp[] =
  92. "user_experience_metrics.client_id_timestamp";
  93. // The metrics client session ID.
  94. const char kMetricsSessionID[] = "user_experience_metrics.session_id";
  95. // The prefix of the last-seen timestamp for persistent histogram files.
  96. // Values are named for the files themselves.
  97. const char kMetricsLastSeenPrefix[] = "user_experience_metrics.last_seen.";
  98. // Array of the number of samples in the memory mapped file.
  99. const char kMetricsFileMetricsMetadata[] =
  100. "user_experience_metrics.file_metrics_metadata";
  101. // The number of times the client has been reset due to cloned install.
  102. const char kClonedResetCount[] = "cloned_install.count";
  103. // The first timestamp when we reset a cloned client’s client id. This is only
  104. // set once. Attached to metrics reports forever thereafter.
  105. const char kFirstClonedResetTimestamp[] = "cloned_install.first_timestamp";
  106. // The last timestamp the client is reset due to cloned install. This will be
  107. // updated every time we reset the client due to cloned install.
  108. const char kLastClonedResetTimestamp[] = "cloned_install.last_timestamp";
  109. // A time stamp at which time the browser was known to be alive. Used to
  110. // evaluate whether the browser crash was due to a whole system crash.
  111. // At minimum this is updated each time the "exited_cleanly" preference is
  112. // modified, but can also be optionally updated on a slow schedule.
  113. const char kStabilityBrowserLastLiveTimeStamp[] =
  114. "user_experience_metrics.stability.browser_last_live_timestamp";
  115. // Number of times the application exited uncleanly since the last report
  116. // due to a gms core update.
  117. const char kStabilityCrashCountDueToGmsCoreUpdate[] =
  118. "user_experience_metrics.stability.crash_count_due_to_gms_core_update";
  119. // True if the previous run of the program exited cleanly.
  120. const char kStabilityExitedCleanly[] =
  121. "user_experience_metrics.stability.exited_cleanly";
  122. // The total number of samples that will be lost if ASSOCIATE_INTERNAL_PROFILE
  123. // isn't enabled since the previous stability recorded, this is different than
  124. // the previous browser run, because one file was just uploaded before the
  125. // stability is recorded.
  126. const char kStabilityFileMetricsUnsentSamplesCount[] =
  127. "user_experience_metrics.stability.file_metrics_unsent_samples_count";
  128. // The number of the unsent files at the time the stability recorded.
  129. const char kStabilityFileMetricsUnsentFilesCount[] =
  130. "user_experience_metrics.stability.file_metrics_unsent_files_count";
  131. // The GMS core version used in Chrome.
  132. const char kStabilityGmsCoreVersion[] =
  133. "user_experience_metrics.stability.gms_core_version";
  134. #if BUILDFLAG(IS_ANDROID)
  135. // Number of times the application was launched since last report. Used on
  136. // Android platforms as WebView may still be interested in this metric.
  137. const char kStabilityLaunchCount[] =
  138. "user_experience_metrics.stability.launch_count";
  139. // Number of times a page load event occurred since the last report.
  140. const char kStabilityPageLoadCount[] =
  141. "user_experience_metrics.stability.page_load_count";
  142. // Number of times a renderer process successfully launched since the last
  143. // report. Used on Android platforms as WebView may still be interested in this
  144. // metric.
  145. const char kStabilityRendererLaunchCount[] =
  146. "user_experience_metrics.stability.renderer_launch_count";
  147. #endif
  148. // Base64 encoded serialized UMA system profile proto from the previous session.
  149. const char kStabilitySavedSystemProfile[] =
  150. "user_experience_metrics.stability.saved_system_profile";
  151. // SHA-1 hash of the serialized UMA system profile proto (hex encoded).
  152. const char kStabilitySavedSystemProfileHash[] =
  153. "user_experience_metrics.stability.saved_system_profile_hash";
  154. // Build time, in seconds since an epoch, which is used to assure that stability
  155. // metrics reported reflect stability of the same build.
  156. const char kStabilityStatsBuildTime[] =
  157. "user_experience_metrics.stability.stats_buildtime";
  158. // Version string of previous run, which is used to assure that stability
  159. // metrics reported under current version reflect stability of the same version.
  160. const char kStabilityStatsVersion[] =
  161. "user_experience_metrics.stability.stats_version";
  162. // Number of times the application exited uncleanly and the system session
  163. // embedding the browser session ended abnormally since the last report.
  164. // Windows only.
  165. const char kStabilitySystemCrashCount[] =
  166. "user_experience_metrics.stability.system_crash_count";
  167. // Dictionary for measuring cellular data used by UKM service during last 7
  168. // days.
  169. const char kUkmCellDataUse[] = "user_experience_metrics.ukm_cell_datause";
  170. // Dictionary for measuring cellular data used by UMA service during last 7
  171. // days.
  172. const char kUmaCellDataUse[] = "user_experience_metrics.uma_cell_datause";
  173. // Dictionary for measuring cellular data used by user including chrome services
  174. // per day.
  175. const char kUserCellDataUse[] = "user_experience_metrics.user_call_datause";
  176. // String for holding user ID associated with the current ongoing UMA
  177. // log. This pref will be used to determine whether to send metrics in case
  178. // of a crash.
  179. const char kMetricsCurrentUserId[] = "metrics.current_user_id";
  180. } // namespace prefs
  181. } // namespace metrics