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

Side by Side Diff: components/scheduler/renderer/task_time_reporter.h

Issue 2184023002: Report the duration of sampled tasks with histogram. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scheduler_export Created 4 years, 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_SCHEDULER_RENDERER_TASK_TIME_REPORTER_H_
6 #define COMPONENTS_SCHEDULER_RENDERER_TASK_TIME_REPORTER_H_
7
8 #include "base/time/time.h"
9 #include "components/scheduler/scheduler_export.h"
10
11 namespace scheduler {
12
13 // Reports the task duration in a histogram for every 100th task. The histogram
14 // ranges from 1 microsecond ~ 1 second with 100 bins. All tasks longer than 1
15 // second will be put into the same bin.
16 class SCHEDULER_EXPORT TaskTimeReporter {
17 public:
18 TaskTimeReporter();
19 ~TaskTimeReporter();
20 void ReportTaskTime(base::TimeDelta duration);
21
22 private:
23 int sample_count_;
24
25 DISALLOW_COPY_AND_ASSIGN(TaskTimeReporter);
26 };
27 }
28
29 #endif // COMPONENTS_SCHEDULER_RENDERER_TASK_TIME_REPORTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698