| 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; |
| 12 } |
| 13 |
| 14 TaskDurationReporter::TaskDurationReporter() : sample_count_(0) {} |
| 15 |
| 16 TaskDurationReporter::~TaskDurationReporter() {} |
| 17 |
| 18 void TaskDurationReporter::ReportTaskDuration(base::TimeDelta duration) { |
| 19 ++sample_count_; |
| 20 if (sample_count_ == kSampleInterval) { |
| 21 UMA_HISTOGRAM_CUSTOM_COUNTS("RendererScheduler.TaskDuration", |
| 22 duration.InMicroseconds(), 1, 1000000, 100); |
| 23 sample_count_ = 0; |
| 24 } |
| 25 } |
| 26 } |
| OLD | NEW |