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

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

Issue 2180373003: Adding reporting of metrics sampling rate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments Created 4 years, 4 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/chrome_metrics_services_manager_client.h
diff --git a/chrome/browser/metrics/chrome_metrics_services_manager_client.h b/chrome/browser/metrics/chrome_metrics_services_manager_client.h
index 51bfe205ad34fa1b82bb5d9aa6963f687102c95b..4979e96c6403f4f549ccba98052b978b881d7d8b 100644
--- a/chrome/browser/metrics/chrome_metrics_services_manager_client.h
+++ b/chrome/browser/metrics/chrome_metrics_services_manager_client.h
@@ -20,11 +20,6 @@ class EnabledStateProvider;
class MetricsStateManager;
}
-// Metrics reporting feature. This feature, along with user consent, controls if
-// recording and reporting are enabled. If the feature is enabled, but no
-// consent is given, then there will be no recording or reporting.
-extern const base::Feature kMetricsReportingFeature;
-
// Provides a //chrome-specific implementation of MetricsServicesManagerClient.
class ChromeMetricsServicesManagerClient
: public metrics_services_manager::MetricsServicesManagerClient {
@@ -32,6 +27,17 @@ class ChromeMetricsServicesManagerClient
explicit ChromeMetricsServicesManagerClient(PrefService* local_state);
~ChromeMetricsServicesManagerClient() override;
+ // Determines if this client is eligible to send metrics. If they are, and
+ // there was user consent, then metrics and crashes would be reported.
+ static bool IsClientInSample();
+
+ // Gets the sample rate for in-sample clients. If the sample rate is not
+ // defined, returns false, and |rate| is unchanged, otherwise returns true,
+ // and |rate| contains the sample rate. If the client isn't in-sample, the
+ // sample rate is undefined. It is also undefined for clients that are not
+ // eligible for sampling.
+ static bool GetSamplingRatePerMille(int* rate);
+
private:
// This is defined as a member class to get access to
// ChromeMetricsServiceAccessor through ChromeMetricsServicesManagerClient's

Powered by Google App Engine
This is Rietveld 408576698