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

Side by Side Diff: components/scheduler/base/queueing_time_estimator.h

Issue 1898233002: Report expected task queueing time via UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove export. Fix windows. Created 4 years, 5 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
« no previous file with comments | « components/scheduler/BUILD.gn ('k') | components/scheduler/base/queueing_time_estimator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_QUEUEING_TIME_ESTIMATOR_H_
6 #define COMPONENTS_SCHEDULER_RENDERER_QUEUEING_TIME_ESTIMATOR_H_
7
8 #include "base/macros.h"
9 #include "base/message_loop/message_loop.h"
10 #include "base/time/time.h"
11 #include "components/scheduler/scheduler_export.h"
12
13 namespace base {
14 class TickClock;
15 }
16
17 namespace scheduler {
18
19 // Records the expected queueing time for a high priority task occurring
20 // randomly during each interval of length |window_duration|.
21 class SCHEDULER_EXPORT QueueingTimeEstimator {
22 public:
23 class SCHEDULER_EXPORT Client {
24 public:
25 virtual void OnQueueingTimeForWindowEstimated(
26 base::TimeDelta queueing_time) = 0;
27 Client() {}
28 virtual ~Client() {}
29
30 private:
31 DISALLOW_COPY_AND_ASSIGN(Client);
32 };
33
34 QueueingTimeEstimator(Client* client,
35 base::TimeDelta window_duration);
36
37 void OnToplevelTaskCompleted(base::TimeTicks task_start_time,
38 base::TimeTicks task_end_time);
39
40 private:
41 bool TimePastWindowEnd(base::TimeTicks task_end_time);
42 Client* client_; // NOT OWNED.
43
44 base::TimeDelta current_expected_queueing_time_;
45 base::TimeDelta window_duration_;
46 base::TimeTicks window_start_time_;
47
48 DISALLOW_COPY_AND_ASSIGN(QueueingTimeEstimator);
49 };
50
51 } // namespace scheduler
52
53 #endif // COMPONENTS_SCHEDULER_RENDERER_QUEUEING_TIME_ESTIMATOR_H_
OLDNEW
« no previous file with comments | « components/scheduler/BUILD.gn ('k') | components/scheduler/base/queueing_time_estimator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698