Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 "components/scheduler/renderer/task_duration_reporter.h" | |
| 6 | |
| 7 #include "base/metrics/histogram_macros.h" | |
| 8 | |
| 9 namespace scheduler { | |
| 10 namespace { | |
| 11 const int kSampleInterval = 100; | |
|
tdresser
2016/07/27 18:04:25
This shouldn't be indented, should it? Play around
sunyunjia
2016/07/27 19:51:04
Done.
| |
| 12 } | |
| 13 | |
| 14 TaskDurationReporter::TaskDurationReporter() : sample_count_(0) {} | |
|
majidvp
2016/07/27 18:34:02
nit: same as above. Should not be indented.
sunyunjia
2016/07/27 19:51:04
Done.
| |
| 15 | |
| 16 TaskDurationReporter::~TaskDurationReporter() {} | |
| 17 | |
| 18 void TaskDurationReporter::ReportSampleDuration(base::TimeDelta duration) { | |
| 19 ++sample_count_; | |
| 20 if (sample_count_ == kSampleInterval) { | |
| 21 // [1msec ~ 10sec], 50 bins. All tasks longer than 10sec will be put into | |
| 22 // the same bin. | |
| 23 UMA_HISTOGRAM_TIMES("RendererScheduler.TaskDuration", duration); | |
|
tdresser
2016/07/27 18:04:25
For input latency, we use
UMA_HISTOGRAM_CUSTOM_C
sunyunjia
2016/07/27 19:51:04
Done.
| |
| 24 sample_count_ = 0; | |
| 25 } | |
| 26 } | |
| 27 } | |
| OLD | NEW |