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

Unified Diff: components/rappor/rappor_service.cc

Issue 419143002: Add DVLOGs of interesting RapporService events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/rappor/rappor_service.cc
diff --git a/components/rappor/rappor_service.cc b/components/rappor/rappor_service.cc
index 67bc4aa0b29651f34e83878446994c088f8f0c31..72a3a5aae5c3bfe5c21720257b9db2f9997f3784 100644
--- a/components/rappor/rappor_service.cc
+++ b/components/rappor/rappor_service.cc
@@ -63,8 +63,12 @@ RapporService::~RapporService() {
void RapporService::Start(PrefService* pref_service,
net::URLRequestContextGetter* request_context) {
const GURL server_url = GetServerUrl();
- if (!server_url.is_valid())
+ if (!server_url.is_valid()) {
+ DVLOG(1) << "RapporService not started: "
+ << server_url.spec() << " is invalid.";
return;
+ }
+ DVLOG(1) << "RapporService started. Reporting to " << server_url.spec();
DCHECK(!uploader_);
LoadSecret(pref_service);
LoadCohort(pref_service);
@@ -78,11 +82,14 @@ void RapporService::Start(PrefService* pref_service,
void RapporService::OnLogInterval() {
DCHECK(uploader_);
+ DVLOG(2) << "RapporService::OnLogInterval";
RapporReports reports;
if (ExportMetrics(&reports)) {
std::string log_text;
bool success = reports.SerializeToString(&log_text);
DCHECK(success);
+ DVLOG(1) << "RapporService sending a report of "
+ << reports.report_size() << " value(s).";
uploader_->QueueLog(log_text);
}
log_rotation_timer_.Start(FROM_HERE,
@@ -111,6 +118,7 @@ void RapporService::LoadCohort(PrefService* pref_service) {
// This is the first time the client has started the service (or their
// preferences were corrupted). Randomly assign them to a cohort.
cohort_ = base::RandGenerator(RapporParameters::kMaxCohorts);
+ DVLOG(2) << "Selected a new Rappor cohort: " << cohort_;
pref_service->SetInteger(prefs::kRapporCohortSeed, cohort_);
}
@@ -126,6 +134,7 @@ void RapporService::LoadSecret(PrefService* pref_service) {
// one.
}
+ DVLOG(2) << "Generated a new Rappor secret.";
secret_ = HmacByteVectorGenerator::GenerateEntropyInput();
base::Base64Encode(secret_, &secret_base64);
pref_service->SetString(prefs::kRapporSecret, secret_base64);
@@ -163,6 +172,9 @@ void RapporService::RecordSample(const std::string& metric_name,
if (!IsInitialized())
return;
DCHECK_LT(type, NUM_RAPPOR_TYPES);
+ DVLOG(2) << "Recording sample \"" << sample
+ << "\" for metric \"" << metric_name
+ << "\" of type: " << type;
RecordSampleInternal(metric_name, kRapporParametersForType[type], sample);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698