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

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: making it a stability histogram Created 4 years, 5 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..b074353879ebeaf929de341441239d719bb2677f 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,15 @@ 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. If the sample rate is not defined, returns false, and
+ // |rate| is unchanged, otherwise returns true, and |rate| contains the sample
+ // rate.
Alexei Svitkine (slow) 2016/08/01 20:28:27 Nit: Expand comment to explain that if rate is not
jwd 2016/08/02 14:26:38 Done.
+ 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