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

Side by Side Diff: components/scheduler/renderer/renderer_task_duration.cc

Issue 2184023002: Report the duration of sampled tasks with histogram. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 #include "base/metrics/histogram_macros.h"
6 #include "components/scheduler/renderer/renderer_task_duration.h"
majidvp 2016/07/27 13:50:59 The class's own header should be included first. T
sunyunjia 2016/07/27 17:28:42 Done.
7
8 namespace scheduler {
9 RendererTaskDuration::RendererTaskDuration()
10 : sample_count_(0) {
majidvp 2016/07/27 13:50:59 The initializer list should be on the same line as
sunyunjia 2016/07/27 17:28:42 Done.
11 }
12
13 RendererTaskDuration::~RendererTaskDuration() {
majidvp 2016/07/27 13:50:59 Move closing brace to the same line for this empty
sunyunjia 2016/07/27 17:28:42 Done.
14 }
15
16 void RendererTaskDuration::ReportSampleDuration(base::TimeDelta duration) {
17 ++sample_count_;
18 if (sample_count_ % kSampleInterval == 0) {
majidvp 2016/07/27 13:50:59 Given that we reset the sample count to 0. Should
sunyunjia 2016/07/27 17:28:42 Done.
19 UMA_HISTOGRAM_TIMES("RendererScheduler.TaskDuration",
majidvp 2016/07/27 13:50:59 UMA_HISTGRAM_TIMES range is 1ms - 10seconds. This
20 duration);
majidvp 2016/07/27 13:50:59 The line break is not needed. Falls within the 80
sunyunjia 2016/07/27 17:28:42 Done.
21 sample_count_ = 0;
22 }
23 }
24 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698