Commit 334de726 authored by Stephen Chenney's avatar Stephen Chenney Committed by Commit Bot

[UKM] Adjust CC and Blink Update sampling to reduce counts

Adjust the exponential decay to decay more rapidly (about 3x higher
exponent) to reduce the number of samples we send.

`

Bug: 1035531
Change-Id: Ie6de6eaca5c6dc49cd2e674e4c9d82f30d59c294
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2003291
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Auto-Submit: Stephen Chenney <schenney@chromium.org>
Reviewed-by: default avatarvmpstr <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732400}
parent 25d7d083
......@@ -42,11 +42,11 @@ unsigned LatencyUkmReporter::SampleFramesToNextEvent() {
double float_sample = 0;
do {
float_sample = -(sample_rate_multiplier_ *
std::exp(samples_so_far_ / sample_decay_rate_) *
std::exp(samples_so_far_ * sample_decay_rate_) *
std::log(1.0 - base::RandDouble()));
} while (float_sample == 0);
// float_sample is positive, so we don't need to worry about underflow.
// After around 100 samples we will end up with a super high
// After around 30 samples we will end up with a super high
// sample. That's OK because it just means we'll stop reporting metrics
// for that session, but we do need to be careful about overflow and NaN.
samples_so_far_++;
......
......@@ -48,13 +48,14 @@ class CC_EXPORT LatencyUkmReporter {
// multiplier. The goal is to get many randomly distributed samples early
// during page load and initial interaction, then samples at an exponentially
// decreasing rate to effectively cap the number of samples. The particular
// parameters chosen here give roughly 10-15 samples in the first 100 frames,
// parameters chosen here give roughly 5-10 samples in the first 100 frames,
// decaying to several hours between samples by the 40th sample. The
// multiplier value should be tuned to achieve a total sample count that
// avoids throttling by the UKM system.
// The sample_rate_multiplier_ has been set to meet UKM goals for data volume.
double sample_decay_rate_ = 3;
double sample_rate_multiplier_ = 4;
// The sample_rate_multiplier_ and sample_decay_rate_ have been set to meet
// UKM goals for data volume.
double sample_decay_rate_ = 1;
double sample_rate_multiplier_ = 2;
unsigned samples_so_far_ = 0;
unsigned frames_to_next_event_ = 0;
......
......@@ -433,11 +433,11 @@ unsigned LocalFrameUkmAggregator::SampleFramesToNextEvent() {
double float_sample = 0;
do {
float_sample = -(sample_rate_multiplier_ *
std::exp(samples_so_far_ / sample_decay_rate_) *
std::exp(samples_so_far_ * sample_decay_rate_) *
std::log(1.0 - base::RandDouble()));
} while (float_sample == 0);
// float_sample is positive, so we don't need to worry about underflow.
// After around 100 samples we will end up with a super high
// After around 30 samples we will end up with a super high
// sample. That's OK because it just means we'll stop reporting metrics
// for that session, but we do need to be careful about overflow and NaN.
samples_so_far_++;
......
......@@ -314,12 +314,12 @@ class CORE_EXPORT LocalFrameUkmAggregator
// multiplier. The goal is to get many randomly distributed samples early
// during page load and initial interaction, then samples at an exponentially
// decreasing rate to effectively cap the number of samples. The particular
// parameters chosen here give roughly 10-15 samples in the first 100 frames,
// parameters chosen here give roughly 5-10 samples in the first 100 frames,
// decaying to several hours between samples by the 40th sample. The
// multiplier value should be tuned to achieve a total sample count that
// avoids throttling by the UKM system.
double sample_decay_rate_ = 3;
double sample_rate_multiplier_ = 4;
// multiplier value and sample_decay_rate_ should be tuned to achieve a total
// sample count that avoids throttling by the UKM system.
double sample_decay_rate_ = 1;
double sample_rate_multiplier_ = 2;
unsigned samples_so_far_ = 0;
unsigned frames_to_next_event_ = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment