| Index: components/scheduler/renderer/task_duration_reporter.cc
|
| diff --git a/components/scheduler/renderer/task_duration_reporter.cc b/components/scheduler/renderer/task_duration_reporter.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b04c7d702d0aaa65760e3d359425daf379d4fc7c
|
| --- /dev/null
|
| +++ b/components/scheduler/renderer/task_duration_reporter.cc
|
| @@ -0,0 +1,26 @@
|
| +// 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 "components/scheduler/renderer/task_duration_reporter.h"
|
| +
|
| +#include "base/metrics/histogram_macros.h"
|
| +
|
| +namespace scheduler {
|
| +namespace {
|
| +const int kSampleInterval = 100;
|
| +}
|
| +
|
| +TaskDurationReporter::TaskDurationReporter() : sample_count_(0) {}
|
| +
|
| +TaskDurationReporter::~TaskDurationReporter() {}
|
| +
|
| +void TaskDurationReporter::ReportTaskDuration(base::TimeDelta duration) {
|
| + ++sample_count_;
|
| + if (sample_count_ == kSampleInterval) {
|
| + UMA_HISTOGRAM_CUSTOM_COUNTS("RendererScheduler.TaskDuration",
|
| + duration.InMicroseconds(), 1, 1000000, 100);
|
| + sample_count_ = 0;
|
| + }
|
| +}
|
| +}
|
|
|