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

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..7d6b52fbd674e63dadc44f6ba265e3fb1c03acda 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:"
Alexei Svitkine (slow) 2014/07/25 14:46:39 Nit: Add a space before the end ".
Steven Holte 2014/07/25 19:16:47 Done.
+ << 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,
@@ -110,6 +117,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.
+ DVLOG(2) << "Selected a new Rappor cohort.";
Alexei Svitkine (slow) 2014/07/25 14:46:39 Nit: Might as well log the cohort_.
Steven Holte 2014/07/25 19:16:47 Done.
cohort_ = base::RandGenerator(RapporParameters::kMaxCohorts);
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;
Alexei Svitkine (slow) 2014/07/25 14:46:39 Nit: Space after :
Steven Holte 2014/07/25 19:16:47 Done.
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