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

Side by Side Diff: base/task_scheduler/scheduler_worker_pool_impl.h

Issue 2412343003: Add TaskScheduler.NumTasksBeforeDetach.[worker pool name] histogram. (Closed)
Patch Set: self-review 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_TASK_SCHEDULER_SCHEDULER_WORKER_POOL_IMPL_H_ 5 #ifndef BASE_TASK_SCHEDULER_SCHEDULER_WORKER_POOL_IMPL_H_
6 #define BASE_TASK_SCHEDULER_SCHEDULER_WORKER_POOL_IMPL_H_ 6 #define BASE_TASK_SCHEDULER_SCHEDULER_WORKER_POOL_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 ExecutionMode execution_mode) override; 87 ExecutionMode execution_mode) override;
88 void ReEnqueueSequence(scoped_refptr<Sequence> sequence, 88 void ReEnqueueSequence(scoped_refptr<Sequence> sequence,
89 const SequenceSortKey& sequence_sort_key) override; 89 const SequenceSortKey& sequence_sort_key) override;
90 bool PostTaskWithSequence(std::unique_ptr<Task> task, 90 bool PostTaskWithSequence(std::unique_ptr<Task> task,
91 scoped_refptr<Sequence> sequence, 91 scoped_refptr<Sequence> sequence,
92 SchedulerWorker* worker) override; 92 SchedulerWorker* worker) override;
93 void PostTaskWithSequenceNow(std::unique_ptr<Task> task, 93 void PostTaskWithSequenceNow(std::unique_ptr<Task> task,
94 scoped_refptr<Sequence> sequence, 94 scoped_refptr<Sequence> sequence,
95 SchedulerWorker* worker) override; 95 SchedulerWorker* worker) override;
96 96
97 const HistogramBase* num_tasks_before_detach_histogram_for_testing() const {
robliao 2016/10/13 18:04:04 Feel free to remove the _for_testing portion of th
fdoray 2016/10/13 20:38:52 Done.
98 return num_tasks_before_detach_histogram_;
99 }
100
97 const HistogramBase* num_tasks_between_waits_histogram_for_testing() const { 101 const HistogramBase* num_tasks_between_waits_histogram_for_testing() const {
98 return num_tasks_between_waits_histogram_; 102 return num_tasks_between_waits_histogram_;
99 } 103 }
100 104
101 private: 105 private:
102 class SchedulerSingleThreadTaskRunner; 106 class SchedulerSingleThreadTaskRunner;
103 class SchedulerWorkerDelegateImpl; 107 class SchedulerWorkerDelegateImpl;
104 108
105 SchedulerWorkerPoolImpl(StringPiece name, 109 SchedulerWorkerPoolImpl(StringPiece name,
106 SchedulerWorkerPoolParams::IORestriction 110 SchedulerWorkerPoolParams::IORestriction
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 182
179 #if DCHECK_IS_ON() 183 #if DCHECK_IS_ON()
180 // Signaled when all workers have been created. 184 // Signaled when all workers have been created.
181 WaitableEvent workers_created_; 185 WaitableEvent workers_created_;
182 #endif 186 #endif
183 187
184 // TaskScheduler.DetachDuration.[worker pool name] histogram. Intentionally 188 // TaskScheduler.DetachDuration.[worker pool name] histogram. Intentionally
185 // leaked. 189 // leaked.
186 HistogramBase* const detach_duration_histogram_; 190 HistogramBase* const detach_duration_histogram_;
187 191
192 // TaskScheduler.NumTasksBeforeDetach.[worker pool name] histogram.
193 // Intentionally leaked.
194 HistogramBase* const num_tasks_before_detach_histogram_;
195
188 // TaskScheduler.NumTasksBetweenWaits.[worker pool name] histogram. 196 // TaskScheduler.NumTasksBetweenWaits.[worker pool name] histogram.
189 // Intentionally leaked. 197 // Intentionally leaked.
190 HistogramBase* const num_tasks_between_waits_histogram_; 198 HistogramBase* const num_tasks_between_waits_histogram_;
191 199
192 // TaskScheduler.TaskLatency.[worker pool name].[task priority] histograms. 200 // TaskScheduler.TaskLatency.[worker pool name].[task priority] histograms.
193 // Indexed by task priority. Histograms are allocated on demand to reduce 201 // Indexed by task priority. Histograms are allocated on demand to reduce
194 // memory usage (some task priorities might never run in this 202 // memory usage (some task priorities might never run in this
195 // SchedulerThreadPoolImpl). Intentionally leaked. 203 // SchedulerThreadPoolImpl). Intentionally leaked.
196 subtle::AtomicWord 204 subtle::AtomicWord
197 task_latency_histograms_[static_cast<int>(TaskPriority::HIGHEST) + 1] = 205 task_latency_histograms_[static_cast<int>(TaskPriority::HIGHEST) + 1] =
198 {}; 206 {};
199 207
200 TaskTracker* const task_tracker_; 208 TaskTracker* const task_tracker_;
201 DelayedTaskManager* const delayed_task_manager_; 209 DelayedTaskManager* const delayed_task_manager_;
202 210
203 DISALLOW_COPY_AND_ASSIGN(SchedulerWorkerPoolImpl); 211 DISALLOW_COPY_AND_ASSIGN(SchedulerWorkerPoolImpl);
204 }; 212 };
205 213
206 } // namespace internal 214 } // namespace internal
207 } // namespace base 215 } // namespace base
208 216
209 #endif // BASE_TASK_SCHEDULER_SCHEDULER_WORKER_POOL_IMPL_H_ 217 #endif // BASE_TASK_SCHEDULER_SCHEDULER_WORKER_POOL_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698