Chromium Code Reviews| Index: base/task_scheduler/task_scheduler_impl.cc |
| diff --git a/base/task_scheduler/task_scheduler_impl.cc b/base/task_scheduler/task_scheduler_impl.cc |
| index 70a71baf7ce45d9ab1ce3632071b863f9cc40b11..561d4c7f76cb7c2bd91723c070b5fb97ff6a0f16 100644 |
| --- a/base/task_scheduler/task_scheduler_impl.cc |
| +++ b/base/task_scheduler/task_scheduler_impl.cc |
| @@ -9,6 +9,7 @@ |
| #include "base/bind.h" |
| #include "base/bind_helpers.h" |
| #include "base/memory/ptr_util.h" |
| +#include "base/metrics/histogram_base.h" |
| #include "base/task_scheduler/scheduler_service_thread.h" |
| #include "base/task_scheduler/scheduler_worker_pool_params.h" |
| #include "base/task_scheduler/sequence_sort_key.h" |
| @@ -52,6 +53,15 @@ scoped_refptr<TaskRunner> TaskSchedulerImpl::CreateTaskRunnerWithTraits( |
| traits, execution_mode); |
| } |
| +std::vector<const HistogramBase*> TaskSchedulerImpl::GetHistograms() { |
|
fdoray
2016/10/14 20:59:05
... GetHistograms() const {
robliao
2016/10/17 22:36:57
Done.
|
| + std::vector<const HistogramBase*> histograms; |
| + for (const auto& worker_pool : worker_pools_) { |
|
fdoray
2016/10/14 20:59:06
Could worker pools have a GetHistograms() method?
robliao
2016/10/17 22:36:57
Done.
|
| + histograms.push_back(worker_pool->detach_duration_histogram()); |
| + histograms.push_back(worker_pool->num_tasks_between_waits_histogram()); |
| + } |
| + return histograms; |
| +} |
| + |
| void TaskSchedulerImpl::Shutdown() { |
| // TODO(fdoray): Increase the priority of BACKGROUND tasks blocking shutdown. |
| task_tracker_.Shutdown(); |