Commit e52da1b8 authored by Tom McKee's avatar Tom McKee Committed by Commit Bot

[scheduler] Rename member variable in QueueingTimeEstimator.

Rename step_queueing_times_ to sliding_window_ to better clarity.

Bug: 883487
Change-Id: I778db437b734a8e498efb69eb3aeff20aeb7cc47
Reviewed-on: https://chromium-review.googlesource.com/c/1299548
Commit-Queue: Tom McKee <tommckee@chromium.org>
Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604623}
parent 713df188
......@@ -143,8 +143,7 @@ bool QueueingTimeEstimator::TimePastStepEnd(base::TimeTicks time) {
}
QueueingTimeEstimator::Calculator::Calculator(int steps_per_window)
: steps_per_window_(steps_per_window),
step_queueing_times_(steps_per_window) {}
: steps_per_window_(steps_per_window), sliding_window_(steps_per_window) {}
void QueueingTimeEstimator::Calculator::UpdateStatusFromTaskQueue(
MainThreadTaskQueue* queue) {
......@@ -164,7 +163,7 @@ void QueueingTimeEstimator::Calculator::AddQueueingTime(
}
void QueueingTimeEstimator::Calculator::EndStep(Client* client) {
step_queueing_times_.Add(step_expected_queueing_time_);
sliding_window_.Add(step_expected_queueing_time_);
DCHECK(client);
// MainThreadSchedulerImpl reports the queueing time once per disjoint window.
......@@ -173,10 +172,10 @@ void QueueingTimeEstimator::Calculator::EndStep(Client* client) {
// Discard: |-------window EQT------|
// Discard: |-------window EQT------|
// Report: |-------window EQT------|
client->OnQueueingTimeForWindowEstimated(step_queueing_times_.GetAverage(),
step_queueing_times_.IndexIsZero());
client->OnQueueingTimeForWindowEstimated(sliding_window_.GetAverage(),
sliding_window_.IndexIsZero());
ResetStep();
if (!step_queueing_times_.IndexIsZero())
if (!sliding_window_.IndexIsZero())
return;
// Report splits by task queue type.
......@@ -247,10 +246,8 @@ void QueueingTimeEstimator::Calculator::ResetStep() {
step_expected_queueing_time_ = base::TimeDelta();
}
QueueingTimeEstimator::RunningAverage::RunningAverage(int size) {
circular_buffer_.resize(size);
index_ = 0;
}
QueueingTimeEstimator::RunningAverage::RunningAverage(int size)
: index_(0), circular_buffer_(size), running_sum_() {}
int QueueingTimeEstimator::RunningAverage::GetStepsPerWindow() const {
return static_cast<int>(circular_buffer_.size());
......
......@@ -90,7 +90,7 @@ class PLATFORM_EXPORT QueueingTimeEstimator {
// In this case:
// |steps_per_window_| = 3, because each window is the length of 3 steps.
base::TimeDelta step_expected_queueing_time_;
RunningAverage step_queueing_times_;
RunningAverage sliding_window_;
// Variables to split Expected Queueing Time by task queue type.
std::array<base::TimeDelta,
......
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