Take into account queue length in autoscaling (#5684)

This commit is contained in:
Eric Liang authored and GitHub committed 2019-09-11 11:31:35 -07:00
1 parent 9ce6dd9b88
commit 2fdefe19b7
6 files changed
+63 -46

No files matched your search

+5 -2
View File
@@ -131,8 +131,11 @@ const Task &SchedulingQueue::GetTaskOfState(const TaskID &task_id,
}
ResourceSet SchedulingQueue::GetResourceLoad() const {
// TODO(atumanov): consider other types of tasks as part of load.
return ready_queue_->GetCurrentResourceLoad();
auto load = ready_queue_->GetCurrentResourceLoad();
// Also take into account infeasible tasks so they show up for autoscaling.
load.AddResources(
task_queues_[static_cast<int>(TaskState::INFEASIBLE)]->GetCurrentResourceLoad());
return load;
}
const std::unordered_set<TaskID> &SchedulingQueue::GetBlockedTaskIds() const {