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

Unified Diff: components/rappor/rappor_service.cc

Issue 727533003: Fix reporting_level_ initialization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2214
Patch Set: Created 6 years, 1 month 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 de814c42affd378c17d57024366ee86755fee831..e6879d29818598f2bb852d07d6cc1417a3f6d7ec 100644
--- a/components/rappor/rappor_service.cc
+++ b/components/rappor/rappor_service.cc
@@ -108,7 +108,7 @@ void RapporService::Start(net::URLRequestContextGetter* request_context,
return;
DVLOG(1) << "RapporService started. Reporting to " << server_url.spec();
DCHECK(!uploader_);
- Initialize(LoadCohort(), LoadSecret(), reporting_level_);
+ Initialize(LoadCohort(), LoadSecret(), reporting_level);
uploader_.reset(new LogUploader(server_url, kMimeType, request_context));
log_rotation_timer_.Start(
FROM_HERE,
@@ -192,8 +192,10 @@ std::string RapporService::LoadSecret() {
}
bool RapporService::ExportMetrics(RapporReports* reports) {
- if (metrics_map_.empty())
+ if (metrics_map_.empty()) {
+ DVLOG(2) << "metrics_map_ is empty.";
return false;
+ }
DCHECK_GE(cohort_, 0);
reports->set_cohort(cohort_);
@@ -236,8 +238,11 @@ void RapporService::RecordSampleInternal(const std::string& metric_name,
DCHECK(IsInitialized());
// Skip this metric if it's reporting level is less than the enabled
// reporting level.
- if (reporting_level_ < parameters.reporting_level)
+ if (reporting_level_ < parameters.reporting_level) {
+ DVLOG(2) << "Metric not logged due to reporting_level "
+ << reporting_level_ << " < " << parameters.reporting_level;
return;
+ }
RapporMetric* metric = LookUpMetric(metric_name, parameters);
metric->AddSample(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