Chromium Code Reviews| Index: components/scheduler/renderer/renderer_task_duration.cc |
| diff --git a/components/scheduler/renderer/renderer_task_duration.cc b/components/scheduler/renderer/renderer_task_duration.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e5c9c89d8ce932f040c1b6f4a617671858fd713d |
| --- /dev/null |
| +++ b/components/scheduler/renderer/renderer_task_duration.cc |
| @@ -0,0 +1,24 @@ |
| +// 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. |
| + |
| +#include "base/metrics/histogram_macros.h" |
| +#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.
|
| + |
| +namespace scheduler { |
| + RendererTaskDuration::RendererTaskDuration() |
| + : 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.
|
| + } |
| + |
| + 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.
|
| + } |
| + |
| + void RendererTaskDuration::ReportSampleDuration(base::TimeDelta duration) { |
| + ++sample_count_; |
| + 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.
|
| + UMA_HISTOGRAM_TIMES("RendererScheduler.TaskDuration", |
|
majidvp
2016/07/27 13:50:59
UMA_HISTGRAM_TIMES range is 1ms - 10seconds. This
|
| + 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.
|
| + sample_count_ = 0; |
| + } |
| + } |
| +} |