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

Side by Side Diff: components/domain_reliability/context.cc

Issue 691163002: Domain Reliability: Histogram upload collector index (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cast upload index to int for histogram 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 unified diff | Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/domain_reliability/context.h" 5 #include "components/domain_reliability/context.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 227
228 size_t collector_index = scheduler_.OnUploadStart(); 228 size_t collector_index = scheduler_.OnUploadStart();
229 229
230 uploader_->UploadReport( 230 uploader_->UploadReport(
231 report_json, 231 report_json,
232 config_->collectors[collector_index]->upload_url, 232 config_->collectors[collector_index]->upload_url,
233 base::Bind( 233 base::Bind(
234 &DomainReliabilityContext::OnUploadComplete, 234 &DomainReliabilityContext::OnUploadComplete,
235 weak_factory_.GetWeakPtr())); 235 weak_factory_.GetWeakPtr()));
236 236
237 UMA_HISTOGRAM_BOOLEAN("DomainReliability.UploadFailover", 237 UMA_HISTOGRAM_SPARSE_SLOWLY("DomainReliability.UploadCollectorIndex",
238 collector_index > 0); 238 static_cast<int>(collector_index));
239 if (!last_upload_time_.is_null()) { 239 if (!last_upload_time_.is_null()) {
240 UMA_HISTOGRAM_LONG_TIMES("DomainReliability.UploadInterval", 240 UMA_HISTOGRAM_LONG_TIMES("DomainReliability.UploadInterval",
241 upload_time_ - last_upload_time_); 241 upload_time_ - last_upload_time_);
242 } 242 }
243 } 243 }
244 244
245 void DomainReliabilityContext::OnUploadComplete(bool success) { 245 void DomainReliabilityContext::OnUploadComplete(bool success) {
246 if (success) 246 if (success)
247 CommitUpload(); 247 CommitUpload();
248 else 248 else
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 313
314 beacons_.pop_front(); 314 beacons_.pop_front();
315 315
316 // If that just removed a beacon counted in uploading_beacons_size_, decrement 316 // If that just removed a beacon counted in uploading_beacons_size_, decrement
317 // that. 317 // that.
318 if (uploading_beacons_size_ > 0) 318 if (uploading_beacons_size_ > 0)
319 --uploading_beacons_size_; 319 --uploading_beacons_size_;
320 } 320 }
321 321
322 } // namespace domain_reliability 322 } // namespace domain_reliability
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698