| Index: components/scheduler/renderer/task_duration_reporter.h
|
| diff --git a/components/scheduler/renderer/task_duration_reporter.h b/components/scheduler/renderer/task_duration_reporter.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8e9c528f2e746039a5e4ec8aafc457049f9bfbbc
|
| --- /dev/null
|
| +++ b/components/scheduler/renderer/task_duration_reporter.h
|
| @@ -0,0 +1,28 @@
|
| +// 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.
|
| +
|
| +#ifndef COMPONENTS_SCHEDULER_RENDERER_TASK_DURATIN_REPORTER_H_
|
| +#define COMPONENTS_SCHEDULER_RENDERER_TASK_DURATIN_REPORTER_H_
|
| +
|
| +#include "base/time/time.h"
|
| +
|
| +namespace scheduler {
|
| +
|
| +// Reports the task duration in a histogram for every 100th task. The histogram
|
| +// ranges from 1 microsecond ~ 1 second with 100 bins. All tasks longer than 1
|
| +// second will be put into the same bin.
|
| +class TaskDurationReporter {
|
| + public:
|
| + TaskDurationReporter();
|
| + ~TaskDurationReporter();
|
| + void ReportTaskDuration(base::TimeDelta duration);
|
| +
|
| + private:
|
| + int sample_count_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(TaskDurationReporter);
|
| +};
|
| +}
|
| +
|
| +#endif // COMPONENTS_SCHEDULER_RENDERER_TASK_DURATIN_REPORTER_H_
|
|
|