summaryrefslogtreecommitdiffstats
path: root/components/domain_reliability
diff options
context:
space:
mode:
authorttuttle <ttuttle@chromium.org>2015-02-11 14:17:35 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-11 22:19:02 +0000
commit17d1302c86810f3313c18894f601e21eb6a45f19 (patch)
tree157597b29f6ebd99a3c91ef1c83e313bfe970463 /components/domain_reliability
parent97aa0551f67ef2780184a769e134dc7f33488590 (diff)
downloadchromium_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.cc6
-rw-r--r--components/domain_reliability/scheduler.h4
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();