Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc

Issue 2278503002: [scheduler] Fix trace counter for renderer main thread load. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/scheduler/renderer/renderer_scheduler_impl.h" 5 #include "platform/scheduler/renderer/renderer_scheduler_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/stack_trace.h" 8 #include "base/debug/stack_trace.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 20 matching lines...) Expand all
31 const double kLoadingTaskEstimationPercentile = 99; 31 const double kLoadingTaskEstimationPercentile = 99;
32 const int kTimerTaskEstimationSampleCount = 1000; 32 const int kTimerTaskEstimationSampleCount = 1000;
33 const double kTimerTaskEstimationPercentile = 99; 33 const double kTimerTaskEstimationPercentile = 99;
34 const int kShortIdlePeriodDurationSampleCount = 10; 34 const int kShortIdlePeriodDurationSampleCount = 10;
35 const double kShortIdlePeriodDurationPercentile = 50; 35 const double kShortIdlePeriodDurationPercentile = 50;
36 // Amount of idle time left in a frame (as a ratio of the vsync interval) above 36 // Amount of idle time left in a frame (as a ratio of the vsync interval) above
37 // which main thread compositing can be considered fast. 37 // which main thread compositing can be considered fast.
38 const double kFastCompositingIdleTimeThreshold = .2; 38 const double kFastCompositingIdleTimeThreshold = .2;
39 39
40 void ReportForegroundRendererTaskLoad(base::TimeTicks time, double load) { 40 void ReportForegroundRendererTaskLoad(base::TimeTicks time, double load) {
41 int load_percentage = static_cast<int>(load * 100);
41 UMA_HISTOGRAM_PERCENTAGE("RendererScheduler.ForegroundRendererMainThreadLoad", 42 UMA_HISTOGRAM_PERCENTAGE("RendererScheduler.ForegroundRendererMainThreadLoad",
42 static_cast<int>(load * 100)); 43 load_percentage);
43 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), 44 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"),
44 "RendererScheduler.ForegroundRendererLoad", load); 45 "RendererScheduler.ForegroundRendererLoad", load_percentage);
45 } 46 }
46 47
47 void ReportBackgroundRendererTaskLoad(base::TimeTicks time, double load) { 48 void ReportBackgroundRendererTaskLoad(base::TimeTicks time, double load) {
49 int load_percentage = static_cast<int>(load * 100);
48 UMA_HISTOGRAM_PERCENTAGE("RendererScheduler.BackgroundRendererMainThreadLoad", 50 UMA_HISTOGRAM_PERCENTAGE("RendererScheduler.BackgroundRendererMainThreadLoad",
49 static_cast<int>(load * 100)); 51 load_percentage);
50 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), 52 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"),
51 "RendererScheduler.BackgroundRendererLoad", load); 53 "RendererScheduler.BackgroundRendererLoad", load_percentage);
52 } 54 }
53 55
54 } // namespace 56 } // namespace
55 57
56 RendererSchedulerImpl::RendererSchedulerImpl( 58 RendererSchedulerImpl::RendererSchedulerImpl(
57 scoped_refptr<SchedulerTqmDelegate> main_task_runner) 59 scoped_refptr<SchedulerTqmDelegate> main_task_runner)
58 : helper_(main_task_runner, 60 : helper_(main_task_runner,
59 "renderer.scheduler", 61 "renderer.scheduler",
60 TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), 62 TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"),
61 TRACE_DISABLED_BY_DEFAULT("renderer.scheduler.debug")), 63 TRACE_DISABLED_BY_DEFAULT("renderer.scheduler.debug")),
(...skipping 1478 matching lines...) Expand 10 before | Expand all | Expand 10 after
1540 case v8::PERFORMANCE_LOAD: 1542 case v8::PERFORMANCE_LOAD:
1541 return "load"; 1543 return "load";
1542 default: 1544 default:
1543 NOTREACHED(); 1545 NOTREACHED();
1544 return nullptr; 1546 return nullptr;
1545 } 1547 }
1546 } 1548 }
1547 1549
1548 } // namespace scheduler 1550 } // namespace scheduler
1549 } // namespace blink 1551 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698