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

[throughput] Fix universal&&video not reporting

There is a mistake in ReportHistogram such that Universal and Video
isn't reporting any UMA. This CL fixes it and added unit tests.

Bug: None
Change-Id: Iedcfd26d17d5db92cc98d91588abd1e0a38c544f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2055877
Auto-Submit: Xida Chen <xidachen@chromium.org>
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#741348}
parent 4810ed2a
......@@ -72,6 +72,21 @@ TEST(FrameSequenceMetricsTest, AllMetricsReported) {
"Graphics.Smoothness.Throughput.SlowerThread.TouchScroll", 2u);
// All the metrics have now been reported. No data should be left over.
EXPECT_FALSE(first.HasDataLeftForReporting());
FrameSequenceMetrics third(FrameSequenceTrackerType::kUniversal, nullptr);
third.impl_throughput().frames_expected = 120;
third.impl_throughput().frames_produced = 80;
third.main_throughput().frames_expected = 120;
third.main_throughput().frames_produced = 80;
EXPECT_TRUE(third.HasEnoughDataForReporting());
third.ReportMetrics();
histograms.ExpectTotalCount(
"Graphics.Smoothness.Throughput.CompositorThread.Universal", 1u);
histograms.ExpectTotalCount(
"Graphics.Smoothness.Throughput.MainThread.Universal", 1u);
histograms.ExpectTotalCount(
"Graphics.Smoothness.Throughput.SlowerThread.Universal", 1u);
}
TEST(FrameSequenceMetricsTest, IrrelevantMetricsNotReported) {
......
......@@ -988,8 +988,11 @@ base::Optional<int> FrameSequenceMetrics::ThroughputData::ReportHistogram(
percent);
}
if (!is_animation && !IsInteractionType(sequence_type))
if (!is_animation && !IsInteractionType(sequence_type) &&
sequence_type != FrameSequenceTrackerType::kUniversal &&
sequence_type != FrameSequenceTrackerType::kVideo) {
return base::nullopt;
}
const char* thread_name =
thread_type == ThreadType::kCompositor
......
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