Commit e00cf3bb authored by Xida Chen's avatar Xida Chen Committed by Commit Bot

[Debug] Remove sampling logic in throughput UKM

Currently the number of throughput UKM reporting is un-expectedly low on
canary channel. We suspect that the sampling logic could cause that.
This CL removes the sampling logic. Once we confirm that the reason is
the sampling, we will likely invent another sampling logic.

Bug: 1029964
Change-Id: I104de8f63ef261a72a9d93edeae2fd62a8235e3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1946872Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#722645}
parent ac795513
...@@ -8,28 +8,12 @@ ...@@ -8,28 +8,12 @@
namespace cc { namespace cc {
namespace {
// Collect UKM once per kNumberOfSamplesToReport UMA reports.
constexpr unsigned kNumberOfSamplesToReport = 2000u;
} // namespace
void ThroughputUkmReporter::ReportThroughputUkm( void ThroughputUkmReporter::ReportThroughputUkm(
const UkmManager* ukm_manager, const UkmManager* ukm_manager,
const base::Optional<int>& slower_throughput_percent, const base::Optional<int>& slower_throughput_percent,
const base::Optional<int>& impl_throughput_percent, const base::Optional<int>& impl_throughput_percent,
const base::Optional<int>& main_throughput_percent, const base::Optional<int>& main_throughput_percent,
FrameSequenceTrackerType type) { FrameSequenceTrackerType type) {
// Sampling control. We sample the event here to not throttle the UKM system.
// Currently, the same sampling rate is applied to all existing trackers. We
// might want to iterate on this based on the collected data.
static uint32_t samples_to_next_event = 0;
if (samples_to_next_event == 0) {
// Sample every 2000 events. Using the Universal tracker as an example
// which reports UMA every 5s, then the system collects UKM once per
// 2000*5 = 10000 seconds, which is about 3 hours. This number may need to
// be tuned to not throttle the UKM system.
samples_to_next_event = kNumberOfSamplesToReport;
if (impl_throughput_percent) { if (impl_throughput_percent) {
ukm_manager->RecordThroughputUKM( ukm_manager->RecordThroughputUKM(
type, FrameSequenceTracker::ThreadType::kCompositor, type, FrameSequenceTracker::ThreadType::kCompositor,
...@@ -43,9 +27,6 @@ void ThroughputUkmReporter::ReportThroughputUkm( ...@@ -43,9 +27,6 @@ void ThroughputUkmReporter::ReportThroughputUkm(
ukm_manager->RecordThroughputUKM(type, ukm_manager->RecordThroughputUKM(type,
FrameSequenceTracker::ThreadType::kSlower, FrameSequenceTracker::ThreadType::kSlower,
slower_throughput_percent.value()); slower_throughput_percent.value());
}
DCHECK_GT(samples_to_next_event, 0u);
samples_to_next_event--;
} }
} // namespace cc } // namespace cc
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