Chromium Code Reviews| Index: components/scheduler/renderer/task_time_reporter.cc |
| diff --git a/components/scheduler/renderer/task_time_reporter.cc b/components/scheduler/renderer/task_time_reporter.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e4ec861818640b4b5414e12fee43252ac5cd8e7b |
| --- /dev/null |
| +++ b/components/scheduler/renderer/task_time_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_time_reporter.h" |
| + |
| +#include "base/metrics/histogram_macros.h" |
| + |
| +namespace scheduler { |
| +namespace { |
| +const int kSampleInterval = 100; |
| +} |
| + |
| +TaskTimeReporter::TaskTimeReporter() : sample_count_(0) {} |
| + |
| +TaskTimeReporter::~TaskTimeReporter() {} |
| + |
| +void TaskTimeReporter::ReportTaskTime(base::TimeDelta duration) { |
| + ++sample_count_; |
| + if (sample_count_ == kSampleInterval) { |
|
Sami
2016/07/28 11:20:26
+brianderson@, didn't we figure out that reducing
tdresser
2016/07/28 12:15:50
Yeah, sounds like that's the case.
majidvp
2016/07/28 13:30:11
The other reason that we considered down-sampling
|
| + UMA_HISTOGRAM_CUSTOM_COUNTS("RendererScheduler.TaskTime", |
| + duration.InMicroseconds(), 1, 1000000, 100); |
|
Ilya Sherman
2016/07/28 00:31:30
Do you really need 100 buckets, or would 50 suffic
Ilya Sherman
2016/07/28 00:38:20
(Expanding this comment, now that I've read throug
tdresser
2016/07/28 12:15:50
Nope, you're right, in terms of memory used, downs
Ilya Sherman
2016/07/28 17:47:41
Let's be really concrete here. With 50 buckets, y
|
| + sample_count_ = 0; |
| + } |
| +} |
| +} |