Commit b9b9a7cc authored by Michael Bai's avatar Michael Bai Committed by Commit Bot

Support simulation of internal-profile reporting

Record the number of files (and their unsent samples) from previous
runs and make those values into stability metrics.

The metrics precisely simulate the INTERNAL_PROFILE behavior and are
only enabled for WebView.

The patch also extends the metrics for used size to M87.

Bug: 1076549

Change-Id: I0356899f13b8b89b9823c81d1eb748ef8ca3ee5d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2293321Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Reviewed-by: default avatarBrian White <bcwhite@chromium.org>
Commit-Queue: Tao Bai <michaelbai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801165}
parent c1355d4a
......@@ -60,11 +60,15 @@ const char* const kPersistentPrefsAllowlist[] = {
// Random seed value for variation's entropy providers. Used to assign
// experiment groups.
metrics::prefs::kMetricsLowEntropySource,
// File metrics metadata.
metrics::prefs::kMetricsFileMetricsMetadata,
// Logged directly in the ChromeUserMetricsExtension proto.
metrics::prefs::kInstallDate,
metrics::prefs::kMetricsReportingEnabledTimestamp,
metrics::prefs::kMetricsSessionID,
// Logged in system_profile.stability fields.
metrics::prefs::kStabilityFileMetricsUnsentFilesCount,
metrics::prefs::kStabilityFileMetricsUnsentSamplesCount,
metrics::prefs::kStabilityLaunchCount,
metrics::prefs::kStabilityPageLoadCount,
metrics::prefs::kStabilityRendererHangCount,
......
......@@ -11,6 +11,7 @@
#include "android_webview/browser_jni_headers/AwMetricsServiceClient_jni.h"
#include "base/android/jni_android.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/persistent_histogram_allocator.h"
#include "base/no_destructor.h"
#include "components/metrics/metrics_pref_names.h"
#include "components/metrics/metrics_service.h"
......@@ -132,6 +133,10 @@ void AwMetricsServiceClient::RegisterAdditionalMetricsProviders(
delegate_->RegisterAdditionalMetricsProviders(service);
}
bool AwMetricsServiceClient::IsPersistentHistogramsEnabled() {
return base::FeatureList::IsEnabled(base::kPersistentHistogramsFeature);
}
// static
void JNI_AwMetricsServiceClient_SetHaveMetricsConsent(JNIEnv* env,
jboolean user_consent,
......
......@@ -134,6 +134,7 @@ class AwMetricsServiceClient : public ::metrics::AndroidMetricsServiceClient,
int GetPackageNameLimitRatePerMille() override;
void RegisterAdditionalMetricsProviders(
metrics::MetricsService* service) override;
bool IsPersistentHistogramsEnabled() override;
private:
bool app_in_foreground_ = false;
......
......@@ -210,16 +210,17 @@ base::LazyInstance<std::string>::Leaky g_environment_for_crash_reporter;
#endif // defined(OS_WIN) || defined(OS_MAC) || defined(OS_ANDROID)
void RegisterFileMetricsPreferences(PrefRegistrySimple* registry) {
metrics::FileMetricsProvider::RegisterPrefs(registry, kBrowserMetricsName);
metrics::FileMetricsProvider::RegisterSourcePrefs(registry,
kBrowserMetricsName);
metrics::FileMetricsProvider::RegisterPrefs(registry,
kCrashpadHistogramAllocatorName);
metrics::FileMetricsProvider::RegisterSourcePrefs(
registry, kCrashpadHistogramAllocatorName);
#if defined(OS_WIN)
metrics::FileMetricsProvider::RegisterPrefs(
metrics::FileMetricsProvider::RegisterSourcePrefs(
registry, installer::kSetupHistogramAllocatorName);
metrics::FileMetricsProvider::RegisterPrefs(
metrics::FileMetricsProvider::RegisterSourcePrefs(
registry, notification_helper::kNotificationHelperHistogramAllocatorName);
#endif
}
......
......@@ -12,6 +12,7 @@
#include "base/base_paths_android.h"
#include "base/files/file_util.h"
#include "base/i18n/rtl.h"
#include "base/metrics/field_trial_params.h"
#include "base/metrics/persistent_histogram_allocator.h"
#include "base/metrics/statistics_recorder.h"
#include "base/path_service.h"
......@@ -135,6 +136,11 @@ void RegisterOrRemovePreviousRunMetricsFile(
}
}
bool IsSamplesCounterEnabled() {
return base::GetFieldTrialParamByFeatureAsBool(
base::kPersistentHistogramsFeature, "prev_run_metrics_count_only", false);
}
std::unique_ptr<metrics::FileMetricsProvider> CreateFileMetricsProvider(
PrefService* pref_service,
bool metrics_reporting_enabled) {
......@@ -158,8 +164,12 @@ std::unique_ptr<metrics::FileMetricsProvider> CreateFileMetricsProvider(
metrics::FileMetricsProvider::Params browser_metrics_params(
browser_metrics_upload_dir,
metrics::FileMetricsProvider::SOURCE_HISTOGRAMS_ATOMIC_DIR,
metrics::FileMetricsProvider::ASSOCIATE_INTERNAL_PROFILE,
IsSamplesCounterEnabled()
? metrics::FileMetricsProvider::
ASSOCIATE_INTERNAL_PROFILE_SAMPLES_COUNTER
: metrics::FileMetricsProvider::ASSOCIATE_INTERNAL_PROFILE,
kBrowserMetricsName);
browser_metrics_params.max_dir_kib = kMaxHistogramStorageKiB;
browser_metrics_params.filter =
base::BindRepeating(FilterBrowserMetricsFiles);
......@@ -192,9 +202,11 @@ AndroidMetricsServiceClient::~AndroidMetricsServiceClient() = default;
// static
void AndroidMetricsServiceClient::RegisterPrefs(PrefRegistrySimple* registry) {
metrics::MetricsService::RegisterPrefs(registry);
metrics::FileMetricsProvider::RegisterPrefs(registry, kBrowserMetricsName);
metrics::FileMetricsProvider::RegisterPrefs(registry,
kCrashpadHistogramAllocatorName);
metrics::FileMetricsProvider::RegisterSourcePrefs(registry,
kBrowserMetricsName);
metrics::FileMetricsProvider::RegisterSourcePrefs(
registry, kCrashpadHistogramAllocatorName);
metrics::FileMetricsProvider::RegisterPrefs(registry);
metrics::StabilityMetricsHelper::RegisterPrefs(registry);
ukm::UkmService::RegisterPrefs(registry);
}
......@@ -259,7 +271,7 @@ void AndroidMetricsServiceClient::CreateMetricsService(
std::make_unique<CPUMetricsProvider>());
metrics_service_->RegisterMetricsProvider(
std::make_unique<ScreenInfoMetricsProvider>());
if (client->EnablePersistentHistograms()) {
if (client->IsPersistentHistogramsEnabled()) {
metrics_service_->RegisterMetricsProvider(CreateFileMetricsProvider(
pref_service_, metrics_state_manager_->IsMetricsReportingEnabled()));
}
......@@ -538,7 +550,7 @@ bool AndroidMetricsServiceClient::IsInPackageNameSample() {
void AndroidMetricsServiceClient::RegisterAdditionalMetricsProviders(
MetricsService* service) {}
bool AndroidMetricsServiceClient::EnablePersistentHistograms() {
bool AndroidMetricsServiceClient::IsPersistentHistogramsEnabled() {
return false;
}
......
......@@ -212,7 +212,7 @@ class AndroidMetricsServiceClient : public MetricsServiceClient,
// client returns true then its
// variations::PlatformFieldTrials::SetupFieldTrials needs to also call
// InstantiatePersistentHistograms.
virtual bool EnablePersistentHistograms();
virtual bool IsPersistentHistogramsEnabled();
// Returns the embedding application's package name (unconditionally). Virtual
// for testing.
......
......@@ -16,6 +16,7 @@
#include "base/files/memory_mapped_file.h"
#include "base/logging.h"
#include "base/metrics/histogram_base.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/persistent_histogram_allocator.h"
#include "base/metrics/persistent_memory_allocator.h"
......@@ -26,12 +27,15 @@
#include "base/task/thread_pool.h"
#include "base/task_runner.h"
#include "base/task_runner_util.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "components/metrics/metrics_pref_names.h"
#include "components/metrics/metrics_service.h"
#include "components/metrics/persistent_histograms.h"
#include "components/metrics/persistent_system_profile.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
namespace metrics {
......@@ -191,7 +195,10 @@ FileMetricsProvider::Params::Params(const base::FilePath& path,
FileMetricsProvider::Params::~Params() {}
FileMetricsProvider::FileMetricsProvider(PrefService* local_state)
: task_runner_(CreateBackgroundTaskRunner()), pref_service_(local_state) {
: task_runner_(CreateBackgroundTaskRunner()),
pref_service_(local_state),
main_task_runner_(base::ThreadTaskRunnerHandle::Get()) {
DCHECK(main_task_runner_);
base::StatisticsRecorder::RegisterHistogramProvider(
weak_factory_.GetWeakPtr());
}
......@@ -216,6 +223,7 @@ void FileMetricsProvider::RegisterSource(const Params& params) {
switch (params.association) {
case ASSOCIATE_CURRENT_RUN:
case ASSOCIATE_INTERNAL_PROFILE:
case ASSOCIATE_INTERNAL_PROFILE_SAMPLES_COUNTER:
sources_to_check_.push_back(std::move(source));
break;
case ASSOCIATE_PREVIOUS_RUN:
......@@ -227,12 +235,18 @@ void FileMetricsProvider::RegisterSource(const Params& params) {
}
// static
void FileMetricsProvider::RegisterPrefs(PrefRegistrySimple* prefs,
const base::StringPiece prefs_key) {
void FileMetricsProvider::RegisterSourcePrefs(
PrefRegistrySimple* prefs,
const base::StringPiece prefs_key) {
prefs->RegisterInt64Pref(metrics::prefs::kMetricsLastSeenPrefix +
prefs_key.as_string(), 0);
}
// static
void FileMetricsProvider::RegisterPrefs(PrefRegistrySimple* prefs) {
prefs->RegisterListPref(metrics::prefs::kMetricsFileMetricsMetadata);
}
// static
void FileMetricsProvider::SetTaskRunnerForTesting(
const scoped_refptr<base::TaskRunner>& task_runner) {
......@@ -373,7 +387,6 @@ void FileMetricsProvider::FinishedWithSource(SourceInfo* source,
}
}
// static
void FileMetricsProvider::CheckAndMergeMetricSourcesOnTaskRunner(
SourceInfoList* sources) {
// This method has all state information passed in |sources| and is intended
......@@ -401,7 +414,11 @@ void FileMetricsProvider::CheckAndMergeMetricSourcesOnTaskRunner(
if (source->association == ASSOCIATE_INTERNAL_PROFILE)
break;
MergeHistogramDeltasFromSource(source.get());
if (source->association == ASSOCIATE_INTERNAL_PROFILE_SAMPLES_COUNTER) {
RecordFileMetadataOnTaskRunner(source.get());
} else {
MergeHistogramDeltasFromSource(source.get());
}
DCHECK(source->read_complete);
}
......@@ -627,6 +644,25 @@ bool FileMetricsProvider::ProvideIndependentMetricsOnTaskRunner(
return false;
}
void FileMetricsProvider::AppendToSamplesCountPref(size_t samples_count) {
ListPrefUpdate update(pref_service_,
metrics::prefs::kMetricsFileMetricsMetadata);
update->Append(static_cast<int>(samples_count));
}
void FileMetricsProvider::RecordFileMetadataOnTaskRunner(SourceInfo* source) {
base::HistogramBase::Count samples_count = 0;
base::PersistentHistogramAllocator::Iterator it{source->allocator.get()};
std::unique_ptr<base::HistogramBase> histogram;
while ((histogram = it.GetNext()) != nullptr) {
samples_count += histogram->SnapshotFinalDelta()->TotalCount();
}
main_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&FileMetricsProvider::AppendToSamplesCountPref,
base::Unretained(this), samples_count));
source->read_complete = true;
}
void FileMetricsProvider::ScheduleSourcesCheck() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
......@@ -643,7 +679,7 @@ void FileMetricsProvider::ScheduleSourcesCheck() {
FROM_HERE,
base::BindOnce(
&FileMetricsProvider::CheckAndMergeMetricSourcesOnTaskRunner,
base::Unretained(check_list)),
base::Unretained(this), base::Unretained(check_list)),
base::BindOnce(&FileMetricsProvider::RecordSourcesChecked,
weak_factory_.GetWeakPtr(), base::Owned(check_list)));
}
......@@ -723,7 +759,7 @@ void FileMetricsProvider::OnDidCreateMetricsLog() {
bool FileMetricsProvider::HasIndependentMetrics() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return !sources_with_profile_.empty();
return !sources_with_profile_.empty() || SimulateIndependentMetrics();
}
void FileMetricsProvider::ProvideIndependentMetrics(
......@@ -844,4 +880,29 @@ void FileMetricsProvider::MergeHistogramDeltas() {
}
}
bool FileMetricsProvider::SimulateIndependentMetrics() {
if (!pref_service_->HasPrefPath(
metrics::prefs::kMetricsFileMetricsMetadata)) {
return false;
}
ListPrefUpdate list_value(pref_service_,
metrics::prefs::kMetricsFileMetricsMetadata);
if (list_value->empty())
return false;
base::Value::ListView mutable_list = list_value->GetList();
size_t count = pref_service_->GetInteger(
metrics::prefs::kStabilityFileMetricsUnsentSamplesCount);
pref_service_->SetInteger(
metrics::prefs::kStabilityFileMetricsUnsentSamplesCount,
mutable_list[0].GetInt() + count);
pref_service_->SetInteger(
metrics::prefs::kStabilityFileMetricsUnsentFilesCount,
list_value->GetSize() - 1);
list_value->EraseListIter(mutable_list.begin());
return true;
}
} // namespace metrics
......@@ -12,6 +12,7 @@
#include "base/callback_forward.h"
#include "base/files/file_path.h"
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "base/metrics/statistics_recorder.h"
#include "base/sequence_checker.h"
......@@ -97,6 +98,15 @@ class FileMetricsProvider : public MetricsProvider,
// that time even though actual transfer will be delayed if an
// embedded profile is found.
ASSOCIATE_INTERNAL_PROFILE_OR_PREVIOUS_RUN,
// Used to only record the metadata of |ASSOCIATE_INTERNAL_PROFILE| but not
// merge the metrics. Instead, write metadata such as the samples count etc,
// to prefs then delete file. To precisely simulate the
// |ASSOCIATE_INTERNAL_PROFILE| behavior, one file record will be read out
// and added to the stability prefs each time the metrics service requests
// the |ASSOCIATE_INTERNAL_PROFILE| source metrics. Finally, the results
// will be recoreded as stability metrics in the next run.
ASSOCIATE_INTERNAL_PROFILE_SAMPLES_COUNTER,
};
enum FilterAction {
......@@ -159,8 +169,8 @@ class FileMetricsProvider : public MetricsProvider,
// Indicates a file or directory to be monitored and how the file or files
// within that directory are used. Because some metadata may need to persist
// across process restarts, preferences entries are used based on the
// |prefs_key| name. Call RegisterPrefs() with the same name to create the
// necessary keys in advance. Set |prefs_key| empty (nullptr will work) if
// |prefs_key| name. Call RegisterSourcePrefs() with the same name to create
// the necessary keys in advance. Set |prefs_key| empty (nullptr will work) if
// no persistence is required. ACTIVE files shouldn't have a pref key as
// they update internal state about what has been previously sent.
void RegisterSource(const Params& params);
......@@ -168,8 +178,10 @@ class FileMetricsProvider : public MetricsProvider,
// Registers all necessary preferences for maintaining persistent state
// about a monitored file across process restarts. The |prefs_key| is
// typically the filename.
static void RegisterPrefs(PrefRegistrySimple* prefs,
const base::StringPiece prefs_key);
static void RegisterSourcePrefs(PrefRegistrySimple* prefs,
const base::StringPiece prefs_key);
static void RegisterPrefs(PrefRegistrySimple* prefs);
// Sets the task runner to use for testing.
static void SetTaskRunnerForTesting(
......@@ -250,7 +262,7 @@ class FileMetricsProvider : public MetricsProvider,
// Checks a list of sources (on a task-runner allowed to do I/O) and merge
// any data found within them.
static void CheckAndMergeMetricSourcesOnTaskRunner(SourceInfoList* sources);
void CheckAndMergeMetricSourcesOnTaskRunner(SourceInfoList* sources);
// Checks a single source and maps it into memory.
static AccessResult CheckAndMapMetricSource(SourceInfo* source);
......@@ -273,6 +285,12 @@ class FileMetricsProvider : public MetricsProvider,
SystemProfileProto* system_profile_proto,
base::HistogramSnapshotManager* snapshot_manager);
// Records the metadata of the |source| to perf.
void RecordFileMetadataOnTaskRunner(SourceInfo* source);
// Appends the samples count to pref on UI thread.
void AppendToSamplesCountPref(size_t samples_count);
// Creates a task to check all monitored sources for updates.
void ScheduleSourcesCheck();
......@@ -306,6 +324,11 @@ class FileMetricsProvider : public MetricsProvider,
std::unique_ptr<SourceInfo> source,
bool success);
// Simulates the independent metrics to read the first item from
// kMetricsBrowserMetricsMetadata and updates the stability prefs accordingly,
// return true if the pref isn't empty.
bool SimulateIndependentMetrics();
// A task-runner capable of performing I/O.
scoped_refptr<base::TaskRunner> task_runner_;
......@@ -326,6 +349,8 @@ class FileMetricsProvider : public MetricsProvider,
// The preferences-service used to store persistent state about sources.
PrefService* pref_service_;
const scoped_refptr<base::TaskRunner> main_task_runner_;
SEQUENCE_CHECKER(sequence_checker_);
base::WeakPtrFactory<FileMetricsProvider> weak_factory_{this};
......
......@@ -75,7 +75,7 @@ class FileMetricsProviderTest : public testing::TestWithParam<bool> {
base::StatisticsRecorder::CreateTemporaryForTesting()),
prefs_(new TestingPrefServiceSimple) {
EXPECT_TRUE(temp_dir_.CreateUniqueTempDir());
FileMetricsProvider::RegisterPrefs(prefs_->registry(), kMetricsName);
FileMetricsProvider::RegisterSourcePrefs(prefs_->registry(), kMetricsName);
FileMetricsProvider::SetTaskRunnerForTesting(task_runner_);
}
......
......@@ -83,6 +83,10 @@ const char kMetricsSessionID[] = "user_experience_metrics.session_id";
const char kMetricsLastSeenPrefix[] =
"user_experience_metrics.last_seen.";
// Array of the number of samples in the memory mapped file.
const char kMetricsFileMetricsMetadata[] =
"user_experience_metrics.file_metrics_metadata";
// Number of times the browser has been able to register crash reporting.
const char kStabilityBreakpadRegistrationSuccess[] =
"user_experience_metrics.stability.breakpad_registration_ok";
......@@ -150,6 +154,17 @@ const char kStabilityExtensionRendererFailedLaunchCount[] =
const char kStabilityExtensionRendererLaunchCount[] =
"user_experience_metrics.stability.extension_renderer_launch_count";
// The total number of samples that will be lost if ASSOCIATE_INTERNAL_PROFILE
// isn't enabled since the previous stability recorded, this is different than
// the previous browser run, because one file was just uploaded before the
// stability is recorded.
const char kStabilityFileMetricsUnsentSamplesCount[] =
"user_experience_metrics.stability.file_metrics_unsent_samples_count";
// The number of the unsent files at the time the stability recorded.
const char kStabilityFileMetricsUnsentFilesCount[] =
"user_experience_metrics.stability.file_metrics_unsent_files_count";
// The GMS core version used in Chrome.
const char kStabilityGmsCoreVersion[] =
"user_experience_metrics.stability.gms_core_version";
......
......@@ -12,6 +12,7 @@ namespace prefs {
// component. Document each in the .cc file.
extern const char kInstallDate[];
extern const char kMetricsClientID[];
extern const char kMetricsFileMetricsMetadata[];
extern const char kMetricsDefaultOptIn[];
extern const char kMetricsInitialLogs[];
extern const char kMetricsInitialLogsMetadata[];
......@@ -47,6 +48,8 @@ extern const char kStabilityExitedCleanly[];
extern const char kStabilityExtensionRendererCrashCount[];
extern const char kStabilityExtensionRendererFailedLaunchCount[];
extern const char kStabilityExtensionRendererLaunchCount[];
extern const char kStabilityFileMetricsUnsentSamplesCount[];
extern const char kStabilityFileMetricsUnsentFilesCount[];
extern const char kStabilityGmsCoreVersion[];
extern const char kStabilityGpuCrashCount[];
extern const char kStabilityIncompleteSessionEndCount[];
......
......@@ -6,12 +6,14 @@
#include <string>
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "build/build_config.h"
#include "components/metrics/metrics_pref_names.h"
#include "components/metrics/stability_metrics_helper.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "third_party/metrics_proto/system_profile.pb.h"
#if defined(OS_ANDROID)
......@@ -67,6 +69,11 @@ void StabilityMetricsProvider::RegisterPrefs(PrefRegistrySimple* registry) {
registry->RegisterIntegerPref(prefs::kStabilityDeferredCount, 0);
registry->RegisterIntegerPref(prefs::kStabilityDiscardCount, 0);
registry->RegisterIntegerPref(prefs::kStabilityVersionMismatchCount, 0);
registry->RegisterIntegerPref(prefs::kStabilityFileMetricsUnsentFilesCount,
0);
registry->RegisterIntegerPref(prefs::kStabilityFileMetricsUnsentSamplesCount,
0);
#if defined(OS_ANDROID)
registry->RegisterStringPref(prefs::kStabilityGmsCoreVersion, "");
registry->RegisterIntegerPref(prefs::kStabilityCrashCountDueToGmsCoreUpdate,
......@@ -98,6 +105,12 @@ void StabilityMetricsProvider::ClearSavedStabilityMetrics() {
// Note: kStabilityDiscardCount is not cleared as its intent is to measure
// the number of times data is discarded, even across versions.
local_state_->SetInteger(prefs::kStabilityVersionMismatchCount, 0);
// The 0 is a valid value for the below prefs, clears pref instead
// of setting to default value.
local_state_->ClearPref(prefs::kStabilityFileMetricsUnsentFilesCount);
local_state_->ClearPref(prefs::kStabilityFileMetricsUnsentSamplesCount);
#if defined(OS_WIN)
local_state_->SetInteger(prefs::kStabilitySystemCrashCount, 0);
#endif
......@@ -160,6 +173,25 @@ void StabilityMetricsProvider::ProvideStabilityMetrics(
"Stability.Internals.VersionMismatchCount", pref_value);
}
if (local_state_->HasPrefPath(prefs::kStabilityFileMetricsUnsentFilesCount)) {
UMA_STABILITY_HISTOGRAM_COUNTS_100(
"Stability.Internals.FileMetricsProvider.BrowserMetrics."
"UnsentFilesCount",
local_state_->GetInteger(prefs::kStabilityFileMetricsUnsentFilesCount));
local_state_->ClearPref(prefs::kStabilityFileMetricsUnsentFilesCount);
}
if (local_state_->HasPrefPath(
prefs::kStabilityFileMetricsUnsentSamplesCount)) {
UMA_STABILITY_HISTOGRAM_CUSTOM_COUNTS(
"Stability.Internals.FileMetricsProvider.BrowserMetrics."
"UnsentSamplesCount",
local_state_->GetInteger(
prefs::kStabilityFileMetricsUnsentSamplesCount),
0, 1000000, 50);
local_state_->ClearPref(prefs::kStabilityFileMetricsUnsentSamplesCount);
}
#if defined(OS_WIN)
if (GetAndClearPrefValue(prefs::kStabilitySystemCrashCount, &pref_value)) {
UMA_STABILITY_HISTOGRAM_COUNTS_100("Stability.Internals.SystemCrashCount",
......
......@@ -161,7 +161,8 @@ void IOSChromeMetricsServiceClient::RegisterPrefs(
PrefRegistrySimple* registry) {
metrics::MetricsService::RegisterPrefs(registry);
metrics::StabilityMetricsHelper::RegisterPrefs(registry);
metrics::FileMetricsProvider::RegisterPrefs(registry, kBrowserMetricsName);
metrics::FileMetricsProvider::RegisterSourcePrefs(registry,
kBrowserMetricsName);
metrics::RegisterMetricsReportingStatePrefs(registry);
ukm::UkmService::RegisterPrefs(registry);
}
......
......@@ -5118,17 +5118,18 @@
]
}
],
"PersistentHistogramsLocalMemory": [
"PersistentHistogramsFileMetrics": [
{
"platforms": [
"android_webview"
],
"experiments": [
{
"name": "EnabledOnLocalMemory",
"name": "EnabledOnFileMetrics",
"params": {
"prev_run_metrics_count_only": "true",
"send_unreported_metrics": "yes",
"storage": "LocalMemory"
"storage": "MappedFile"
},
"enable_features": [
"PersistentHistograms"
......
......@@ -374,7 +374,7 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</histogram>
<histogram base="true" name="UMA.PersistentAllocator.UsedPct" units="%"
expires_after="M85">
expires_after="M87">
<owner>bcwhite@chromium.org</owner>
<owner>asvitkine@chromium.org</owner>
<owner>src/base/metrics/OWNERS</owner>
......
......@@ -153,7 +153,7 @@ void WebLayerMetricsServiceClient::RegisterAdditionalMetricsProviders(
service->RegisterMetricsProvider(std::make_unique<PageLoadMetricsProvider>());
}
bool WebLayerMetricsServiceClient::EnablePersistentHistograms() {
bool WebLayerMetricsServiceClient::IsPersistentHistogramsEnabled() {
return true;
}
......
......@@ -48,7 +48,7 @@ class WebLayerMetricsServiceClient
int GetPackageNameLimitRatePerMille() override;
void RegisterAdditionalMetricsProviders(
metrics::MetricsService* service) override;
bool EnablePersistentHistograms() override;
bool IsPersistentHistogramsEnabled() override;
bool IsOffTheRecordSessionActive() override;
scoped_refptr<network::SharedURLLoaderFactory> GetURLLoaderFactory() override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment