Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(958)

Unified Diff: base/task_scheduler/task_scheduler_impl.cc

Issue 2420973002: Plumb Task Scheduler Histograms to the Task Scheduler Internals Page (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698