Skip to content

Commit

Permalink
[Code health] Rename a function in FrameSequenceTracker
Browse files Browse the repository at this point in the history
The ReportMetrics function in the FrameSequenceTracker is called by
testing code only. To avoid confusion, this CL renames it to
ReportMetricsForTesting.

Bug: None
Change-Id: I1b85a0b6cdcaaa009d145fef894e451c3623a933
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1972430
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#725832}
  • Loading branch information
xidachen authored and Commit Bot committed Dec 18, 2019
1 parent 159ff81 commit bfab97a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cc/metrics/frame_sequence_tracker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ FrameSequenceTracker::FrameSequenceTracker(
FrameSequenceTracker::~FrameSequenceTracker() {
}

void FrameSequenceTracker::ReportMetrics() {
void FrameSequenceTracker::ReportMetricsForTesting() {
metrics_->ReportMetrics();
}

Expand Down
4 changes: 2 additions & 2 deletions cc/metrics/frame_sequence_tracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class CC_EXPORT FrameSequenceMetrics {
void Merge(std::unique_ptr<FrameSequenceMetrics> metrics);
bool HasEnoughDataForReporting() const;
bool HasDataLeftForReporting() const;
// Report related metrics: throughput, checkboarding...
void ReportMetrics();

ThroughputData& impl_throughput() { return impl_throughput_; }
Expand Down Expand Up @@ -325,8 +326,7 @@ class CC_EXPORT FrameSequenceTracker {

bool ShouldIgnoreSequence(uint64_t sequence_number) const;

// Report related metrics: throughput, checkboarding...
void ReportMetrics();
void ReportMetricsForTesting();

const FrameSequenceTrackerType type_;

Expand Down
10 changes: 5 additions & 5 deletions cc/metrics/frame_sequence_tracker_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class FrameSequenceTrackerTest : public testing::Test {
// Test that there is no main thread frames expected.
tracker_->impl_throughput().frames_expected = 100u;
tracker_->impl_throughput().frames_produced = 85u;
tracker_->ReportMetrics();
tracker_->ReportMetricsForTesting();
histogram_tester.ExpectTotalCount(
"Graphics.Smoothness.Throughput.CompositorThread.TouchScroll", 1u);
histogram_tester.ExpectTotalCount(
Expand All @@ -135,7 +135,7 @@ class FrameSequenceTrackerTest : public testing::Test {
tracker_->impl_throughput().frames_produced = 85u;
tracker_->main_throughput().frames_expected = 150u;
tracker_->main_throughput().frames_produced = 25u;
tracker_->ReportMetrics();
tracker_->ReportMetricsForTesting();
histogram_tester.ExpectTotalCount(
"Graphics.Smoothness.Throughput.CompositorThread.TouchScroll", 2u);
histogram_tester.ExpectTotalCount(
Expand All @@ -148,7 +148,7 @@ class FrameSequenceTrackerTest : public testing::Test {
tracker_->main_throughput().frames_produced = 1u;
tracker_->impl_throughput().frames_expected = 2u;
tracker_->impl_throughput().frames_produced = 1u;
tracker_->ReportMetrics();
tracker_->ReportMetricsForTesting();
histogram_tester.ExpectTotalCount(
"Graphics.Smoothness.Throughput.CompositorThread.TouchScroll", 2u);
histogram_tester.ExpectTotalCount(
Expand All @@ -161,7 +161,7 @@ class FrameSequenceTrackerTest : public testing::Test {
tracker_->impl_throughput().frames_produced = 118u;
tracker_->main_throughput().frames_expected = 120u;
tracker_->main_throughput().frames_produced = 118u;
tracker_->ReportMetrics();
tracker_->ReportMetricsForTesting();
histogram_tester.ExpectTotalCount(
"Graphics.Smoothness.Throughput.CompositorThread.TouchScroll", 3u);
histogram_tester.ExpectTotalCount(
Expand All @@ -170,7 +170,7 @@ class FrameSequenceTrackerTest : public testing::Test {
"Graphics.Smoothness.Throughput.SlowerThread.TouchScroll", 3u);
}

void ReportMetrics() { tracker_->ReportMetrics(); }
void ReportMetrics() { tracker_->ReportMetricsForTesting(); }

base::TimeDelta TimeDeltaToReort() const {
return tracker_->time_delta_to_report_;
Expand Down

0 comments on commit bfab97a

Please sign in to comment.