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

Unified Diff: base/task_scheduler/task_tracker.h

Issue 2600023002: Remove worker pool names from TaskScheduler.TaskLatency.* histograms. (Closed)
Patch Set: CR gab #15 (remove friend) Created 3 years, 11 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
« no previous file with comments | « base/task_scheduler/scheduler_worker_unittest.cc ('k') | base/task_scheduler/task_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/task_tracker.h
diff --git a/base/task_scheduler/task_tracker.h b/base/task_scheduler/task_tracker.h
index a5caf213985ea20bd986cafb70bea32d76891207..14ca1f419329dc9cb890eab9e9693f5419d8d250 100644
--- a/base/task_scheduler/task_tracker.h
+++ b/base/task_scheduler/task_tracker.h
@@ -21,13 +21,15 @@
namespace base {
class ConditionVariable;
+class HistogramBase;
class SequenceToken;
namespace internal {
// All tasks go through the scheduler's TaskTracker when they are posted and
-// when they are executed. The TaskTracker enforces shutdown semantics and takes
-// care of tracing and profiling. This class is thread-safe.
+// when they are executed. The TaskTracker sets up the environment to run tasks,
+// enforces shutdown semantics, records metrics, and takes care of tracing and
+// profiling. This class is thread-safe.
class BASE_EXPORT TaskTracker {
public:
TaskTracker();
@@ -106,6 +108,10 @@ class BASE_EXPORT TaskTracker {
// it reaches zero.
void DecrementNumPendingUndelayedTasks();
+ // Records the TaskScheduler.TaskLatency.[task priority].[may block] histogram
+ // for |task|.
+ void RecordTaskLatencyHistogram(Task* task);
+
// Number of tasks blocking shutdown and boolean indicating whether shutdown
// has started.
const std::unique_ptr<State> state_;
@@ -133,6 +139,12 @@ class BASE_EXPORT TaskTracker {
// completes.
std::unique_ptr<WaitableEvent> shutdown_event_;
+ // TaskScheduler.TaskLatency.[task priority].[may block] histograms. The first
+ // index is a TaskPriority. The second index is 0 for non-blocking tasks, 1
+ // for blocking tasks. Intentionally leaked.
+ HistogramBase* const
+ task_latency_histograms_[static_cast<int>(TaskPriority::HIGHEST) + 1][2];
+
// Number of BLOCK_SHUTDOWN tasks posted during shutdown.
HistogramBase::Sample num_block_shutdown_tasks_posted_during_shutdown_ = 0;
« no previous file with comments | « base/task_scheduler/scheduler_worker_unittest.cc ('k') | base/task_scheduler/task_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698