Commit b02659e0 authored by Sadrul Habib Chowdhury's avatar Sadrul Habib Chowdhury Committed by Commit Bot

[cc/metrics] Do not report latency metrics for Universal sequence.

It is not necessary to report the various latency metrics for the
Universal sequence, since the un-prefixed metric is equivalent.

BUG=none

Change-Id: I82caf09752288e6dbfe3c2781be1668e0d2a10af
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1996154
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: default avatarBehdad Bakhshinategh <behdadb@chromium.org>
Auto-Submit: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#731836}
parent e744b301
......@@ -127,10 +127,17 @@ constexpr int kHistogramMin = 1;
constexpr int kHistogramMax = 350000;
constexpr int kHistogramBucketCount = 50;
bool ShouldReportLatencyMetricsForSequenceType(
FrameSequenceTrackerType sequence_type) {
return sequence_type != FrameSequenceTrackerType::kUniversal;
}
std::string HistogramName(const int report_type_index,
FrameSequenceTrackerType frame_sequence_tracker_type,
const int stage_type_index) {
DCHECK_LE(frame_sequence_tracker_type, FrameSequenceTrackerType::kMaxType);
DCHECK(
ShouldReportLatencyMetricsForSequenceType(frame_sequence_tracker_type));
const char* tracker_type_name =
FrameSequenceTracker::GetFrameSequenceTrackerTypeName(
frame_sequence_tracker_type);
......@@ -298,6 +305,8 @@ void CompositorFrameReporter::ReportStageHistogramWithBreakdown(
CompositorFrameReporter::MissedFrameReportTypes report_type,
const CompositorFrameReporter::StageData& stage,
FrameSequenceTrackerType frame_sequence_tracker_type) const {
if (!ShouldReportLatencyMetricsForSequenceType(frame_sequence_tracker_type))
return;
base::TimeDelta stage_delta = stage.end_time - stage.start_time;
ReportHistogram(report_type, frame_sequence_tracker_type,
static_cast<int>(stage.stage_type), stage_delta);
......
......@@ -1037,8 +1037,10 @@ void LayerTreeTest::RunTest(CompositorMode mode) {
std::make_unique<viz::TestGpuMemoryBufferManager>();
task_graph_runner_.reset(new TestTaskGraphRunner);
if (mode == CompositorMode::THREADED)
if (mode == CompositorMode::THREADED) {
settings_.commit_to_active_tree = false;
settings_.single_thread_proxy_scheduler = false;
}
// Disable latency recovery to make the scheduler more predictable in its
// actions and less dependent on timings to make decisions.
settings_.enable_latency_recovery = false;
......
......@@ -8,6 +8,7 @@
#include <climits>
#include "base/bind.h"
#include "base/metrics/statistics_recorder.h"
#include "cc/animation/animation.h"
#include "cc/animation/animation_curve.h"
#include "cc/animation/animation_host.h"
......@@ -1044,6 +1045,10 @@ class LayerTreeHostPresentationDuringAnimation
EXPECT_GT(request_token_, 0u);
EXPECT_GT(received_token_, request_token_);
EXPECT_GE(received_token_, 5u);
EXPECT_TRUE(base::StatisticsRecorder::FindHistogram(
"CompositorLatency.TotalLatency"));
EXPECT_FALSE(base::StatisticsRecorder::FindHistogram(
"CompositorLatency.Universal.TotalLatency"));
}
private:
......
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