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

Unified Diff: components/scheduler/base/task_time_tracker.h

Issue 1898233002: Report expected task queueing time via UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix perf test 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 side-by-side diff with in-line comments
Download patch
Index: components/scheduler/base/task_time_tracker.h
diff --git a/components/scheduler/base/task_time_tracker.h b/components/scheduler/base/task_time_tracker.h
new file mode 100644
index 0000000000000000000000000000000000000000..7328f89d6a01aea8a077c28eefa80b0484555317
--- /dev/null
+++ b/components/scheduler/base/task_time_tracker.h
@@ -0,0 +1,47 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_RENDERER_SCHEDULER_BASE_TASK_TIME_TRACKER_H_
+#define CONTENT_RENDERER_SCHEDULER_BASE_TASK_TIME_TRACKER_H_
+
+#include <memory>
+#include <vector>
+
+#include "base/macros.h"
+#include "base/time/default_tick_clock.h"
+#include "base/time/time.h"
+#include "components/scheduler/base/queueing_time_estimator.h"
+#include "components/scheduler/scheduler_export.h"
+
+namespace base {
+class TickClock;
Sami 2016/07/05 14:40:39 Unused?
tdresser 2016/07/05 15:52:20 Done.
+}
+
+namespace scheduler {
+
+class SCHEDULER_EXPORT TaskTimeTracker : public QueueingTimeEstimator::Client {
Sami 2016/07/05 14:40:39 I'm wondering if this should just be a virtual int
alex clarke (OOO till 29th) 2016/07/05 14:59:35 +1 we'd like to use the timings for other purposes
tdresser 2016/07/05 20:09:38 Done.
+ public:
+ class TaskTimeObserver {
+ public:
+ virtual void OnQueueingTimeForWindowEstimated(
+ base::TimeDelta queueing_time) = 0;
+ virtual ~TaskTimeObserver() {}
+ };
+
+ TaskTimeTracker();
+ ~TaskTimeTracker() override;
+
+ void ReportTaskTime(base::TimeTicks startTime, base::TimeTicks endTime);
+ void SetObserver(TaskTimeObserver*);
+
+ // QueueingTimeEstimator::Client implementation:
+ void OnQueueingTimeForWindowEstimated(base::TimeDelta queueing_time) override;
+
+ TaskTimeObserver* task_time_observer_; // Not Owned
Sami 2016/07/05 14:40:39 Did you mean to make these private? This observer
tdresser 2016/07/05 15:52:20 Yeah, they're private in the next patch. Removed
+ QueueingTimeEstimator queueing_time_estimator_;
+}; // scheduler
alex clarke (OOO till 29th) 2016/07/05 13:47:45 nit: DISALLOW_COPY_AND_ASSIGN
tdresser 2016/07/05 14:30:13 Eeep - and also add "private". Done.
+
+#endif // CONTENT_RENDERER_SCHEDULER_BASE_TASK_TIME_TRACKER_H_
+
+}
Sami 2016/07/05 14:40:39 This brace seems misplaced.
tdresser 2016/07/05 20:09:38 Done.

Powered by Google App Engine
This is Rietveld 408576698