diff options
author | ttuttle <ttuttle@chromium.org> | 2015-02-11 14:17:35 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-11 22:19:02 +0000 |
commit | 17d1302c86810f3313c18894f601e21eb6a45f19 (patch) | |
tree | 157597b29f6ebd99a3c91ef1c83e313bfe970463 /components/domain_reliability | |
parent | 97aa0551f67ef2780184a769e134dc7f33488590 (diff) | |
download | chromium_src-17d1302c86810f3313c18894f601e21eb6a45f19.zip chromium_src-17d1302c86810f3313c18894f601e21eb6a45f19.tar.gz chromium_src-17d1302c86810f3313c18894f601e21eb6a45f19.tar.bz2 |
Domain Reliability: Measure record-to-upload latency for beacons.
Measure the time between the first beacon of an upload and the end of
the request that successfully uploads it.
Once we have some data on this, we will find some nice long-tail
percentile, assume uploads that take longer than that will never
succeed, and use that to measure how many beacons never get uploaded.
BUG=
Review URL: https://codereview.chromium.org/911693002
Cr-Commit-Position: refs/heads/master@{#315853}
Diffstat (limited to 'components/domain_reliability')
-rw-r--r-- | components/domain_reliability/context.cc | 6 | ||||
-rw-r--r-- | components/domain_reliability/scheduler.h | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/components/domain_reliability/context.cc b/components/domain_reliability/context.cc index 730d344..ad63776 100644 --- a/components/domain_reliability/context.cc +++ b/components/domain_reliability/context.cc @@ -250,12 +250,16 @@ void DomainReliabilityContext::OnUploadComplete( CommitUpload(); else RollbackUpload(); + base::TimeTicks first_beacon_time = scheduler_.first_beacon_time(); scheduler_.OnUploadComplete(result); UMA_HISTOGRAM_BOOLEAN("DomainReliability.UploadSuccess", result.is_success()); + base::TimeTicks now = time_->NowTicks(); + UMA_HISTOGRAM_LONG_TIMES("DomainReliability.UploadLatency", + now - first_beacon_time); DCHECK(!upload_time_.is_null()); UMA_HISTOGRAM_MEDIUM_TIMES("DomainReliability.UploadDuration", - time_->NowTicks() - upload_time_); + now - upload_time_); last_upload_time_ = upload_time_; upload_time_ = base::TimeTicks(); } diff --git a/components/domain_reliability/scheduler.h b/components/domain_reliability/scheduler.h index aac257e..8fcd239 100644 --- a/components/domain_reliability/scheduler.h +++ b/components/domain_reliability/scheduler.h @@ -78,6 +78,10 @@ class DOMAIN_RELIABILITY_EXPORT DomainReliabilityScheduler { // unit tests. void MakeDeterministicForTesting(); + // Gets the time of the first beacon that has not yet been successfully + // uploaded. + base::TimeTicks first_beacon_time() const { return first_beacon_time_; } + private: void MaybeScheduleUpload(); |