Skip to content

Commit

Permalink
Moved metric related files to cc/metrics
Browse files Browse the repository at this point in the history
Bug: chromium:990470
Change-Id: I239ef42d8c9c1c42f27497f720d84ca816d49caf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1739387
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Robert Flack <flackr@chromium.org>
Commit-Queue: Behdad Bakhshinategh <behdadb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686073}
  • Loading branch information
behdad authored and Commit Bot committed Aug 12, 2019
1 parent 14b87f8 commit 5fb48ea
Show file tree
Hide file tree
Showing 21 changed files with 204 additions and 70 deletions.
24 changes: 12 additions & 12 deletions cc/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@ cc_component("cc") {
"layers/video_layer_impl.h",
"layers/viewport.cc",
"layers/viewport.h",
"metrics/compositor_frame_reporter.cc",
"metrics/compositor_frame_reporter.h",
"metrics/compositor_frame_reporting_controller.cc",
"metrics/compositor_frame_reporting_controller.h",
"metrics/compositor_timing_history.cc",
"metrics/compositor_timing_history.h",
"metrics/frame_sequence_tracker.cc",
"metrics/frame_sequence_tracker.h",
"raster/bitmap_raster_buffer_provider.cc",
"raster/bitmap_raster_buffer_provider.h",
"raster/gpu_raster_buffer_provider.cc",
Expand Down Expand Up @@ -208,12 +216,6 @@ cc_component("cc") {
"scheduler/begin_frame_tracker.cc",
"scheduler/begin_frame_tracker.h",
"scheduler/commit_earlyout_reason.h",
"scheduler/compositor_frame_reporter.cc",
"scheduler/compositor_frame_reporter.h",
"scheduler/compositor_frame_reporting_controller.cc",
"scheduler/compositor_frame_reporting_controller.h",
"scheduler/compositor_timing_history.cc",
"scheduler/compositor_timing_history.h",
"scheduler/draw_result.h",
"scheduler/scheduler.cc",
"scheduler/scheduler.h",
Expand Down Expand Up @@ -290,8 +292,6 @@ cc_component("cc") {
"trees/effect_node.h",
"trees/frame_rate_counter.cc",
"trees/frame_rate_counter.h",
"trees/frame_sequence_tracker.cc",
"trees/frame_sequence_tracker.h",
"trees/image_animation_controller.cc",
"trees/image_animation_controller.h",
"trees/latency_info_swap_promise.cc",
Expand Down Expand Up @@ -633,6 +633,10 @@ cc_test("cc_unittests") {
"layers/video_frame_provider_client_impl_unittest.cc",
"layers/video_layer_impl_unittest.cc",
"layers/viewport_unittest.cc",
"metrics/compositor_frame_reporter_unittest.cc",
"metrics/compositor_frame_reporting_controller_unittest.cc",
"metrics/compositor_timing_history_unittest.cc",
"metrics/frame_sequence_tracker_unittest.cc",
"mojo_embedder/async_layer_tree_frame_sink_unittest.cc",
"paint/discardable_image_map_unittest.cc",
"paint/display_item_list_unittest.cc",
Expand All @@ -658,9 +662,6 @@ cc_test("cc_unittests") {
"raster/synchronous_task_graph_runner_unittest.cc",
"raster/task_graph_work_queue_unittest.cc",
"resources/resource_pool_unittest.cc",
"scheduler/compositor_frame_reporter_unittest.cc",
"scheduler/compositor_frame_reporting_controller_unittest.cc",
"scheduler/compositor_timing_history_unittest.cc",
"scheduler/scheduler_state_machine_unittest.cc",
"scheduler/scheduler_unittest.cc",
"test/layer_tree_json_parser_unittest.cc",
Expand All @@ -676,7 +677,6 @@ cc_test("cc_unittests") {
"tiles/tile_manager_unittest.cc",
"tiles/tile_priority_unittest.cc",
"trees/damage_tracker_unittest.cc",
"trees/frame_sequence_tracker_unittest.cc",
"trees/image_animation_controller_unittest.cc",
"trees/layer_tree_frame_sink_unittest.cc",
"trees/layer_tree_host_common_unittest.cc",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "cc/scheduler/compositor_frame_reporter.h"
#include "cc/metrics/compositor_frame_reporter.h"

#include <string>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CC_SCHEDULER_COMPOSITOR_FRAME_REPORTER_H_
#define CC_SCHEDULER_COMPOSITOR_FRAME_REPORTER_H_
#ifndef CC_METRICS_COMPOSITOR_FRAME_REPORTER_H_
#define CC_METRICS_COMPOSITOR_FRAME_REPORTER_H_

#include <vector>

Expand Down Expand Up @@ -126,4 +126,4 @@ class CC_EXPORT CompositorFrameReporter {
};
} // namespace cc

#endif // CC_SCHEDULER_COMPOSITOR_FRAME_REPORTER_H_"
#endif // CC_METRICS_COMPOSITOR_FRAME_REPORTER_H_"
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "cc/scheduler/compositor_frame_reporter.h"
#include "cc/metrics/compositor_frame_reporter.h"

#include "base/test/metrics/histogram_tester.h"
#include "cc/scheduler/compositor_frame_reporting_controller.h"
#include "cc/metrics/compositor_frame_reporting_controller.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace cc {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "cc/scheduler/compositor_frame_reporting_controller.h"
#include "cc/metrics/compositor_frame_reporting_controller.h"

#include "cc/scheduler/compositor_frame_reporter.h"
#include "cc/metrics/compositor_frame_reporter.h"
#include "components/viz/common/quads/compositor_frame_metadata.h"

namespace cc {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CC_SCHEDULER_COMPOSITOR_FRAME_REPORTING_CONTROLLER_H_
#define CC_SCHEDULER_COMPOSITOR_FRAME_REPORTING_CONTROLLER_H_
#ifndef CC_METRICS_COMPOSITOR_FRAME_REPORTING_CONTROLLER_H_
#define CC_METRICS_COMPOSITOR_FRAME_REPORTING_CONTROLLER_H_

#include <memory>
#include <vector>
Expand All @@ -12,7 +12,7 @@
#include "cc/base/base_export.h"
#include "cc/base/rolling_time_delta_history.h"
#include "cc/cc_export.h"
#include "cc/scheduler/compositor_frame_reporter.h"
#include "cc/metrics/compositor_frame_reporter.h"

namespace cc {
class RollingTimeDeltaHistory;
Expand Down Expand Up @@ -90,4 +90,4 @@ class CC_EXPORT CompositorFrameReportingController {
};
} // namespace cc

#endif // CC_SCHEDULER_COMPOSITOR_FRAME_REPORTING_CONTROLLER_H_
#endif // CC_METRICS_COMPOSITOR_FRAME_REPORTING_CONTROLLER_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "cc/scheduler/compositor_frame_reporting_controller.h"
#include "cc/metrics/compositor_frame_reporting_controller.h"

#include "base/macros.h"
#include "base/test/metrics/histogram_tester.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "cc/scheduler/compositor_timing_history.h"
#include "cc/metrics/compositor_timing_history.h"

#include <stddef.h>
#include <stdint.h>
Expand All @@ -12,7 +12,7 @@
#include "base/stl_util.h"
#include "base/trace_event/trace_event.h"
#include "cc/debug/rendering_stats_instrumentation.h"
#include "cc/scheduler/compositor_frame_reporting_controller.h"
#include "cc/metrics/compositor_frame_reporting_controller.h"

namespace cc {

Expand Down Expand Up @@ -89,35 +89,170 @@ const double kDrawEstimationPercentile = 90.0;
// ~90 VSync aligned UMA buckets.
const int kUMAVSyncBuckets[] = {
// Powers of two from 0 to 2048 us @ 50% precision
1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048,
1,
2,
4,
8,
16,
32,
64,
128,
256,
512,
1024,
2048,
// Every 8 Hz from 256 Hz to 128 Hz @ 3-6% precision
3906, 4032, 4167, 4310, 4464, 4630, 4808, 5000, 5208, 5435, 5682, 5952,
6250, 6579, 6944, 7353,
3906,
4032,
4167,
4310,
4464,
4630,
4808,
5000,
5208,
5435,
5682,
5952,
6250,
6579,
6944,
7353,
// Every 4 Hz from 128 Hz to 64 Hz @ 3-6% precision
7813, 8065, 8333, 8621, 8929, 9259, 9615, 10000, 10417, 10870, 11364, 11905,
12500, 13158, 13889, 14706,
7813,
8065,
8333,
8621,
8929,
9259,
9615,
10000,
10417,
10870,
11364,
11905,
12500,
13158,
13889,
14706,
// Every 2 Hz from 64 Hz to 32 Hz @ 3-6% precision
15625, 16129, 16667, 17241, 17857, 18519, 19231, 20000, 20833, 21739, 22727,
23810, 25000, 26316, 27778, 29412,
15625,
16129,
16667,
17241,
17857,
18519,
19231,
20000,
20833,
21739,
22727,
23810,
25000,
26316,
27778,
29412,
// Every 1 Hz from 32 Hz to 1 Hz @ 3-33% precision
31250, 32258, 33333, 34483, 35714, 37037, 38462, 40000, 41667, 43478, 45455,
47619, 50000, 52632, 55556, 58824, 62500, 66667, 71429, 76923, 83333, 90909,
100000, 111111, 125000, 142857, 166667, 200000, 250000, 333333, 500000,
31250,
32258,
33333,
34483,
35714,
37037,
38462,
40000,
41667,
43478,
45455,
47619,
50000,
52632,
55556,
58824,
62500,
66667,
71429,
76923,
83333,
90909,
100000,
111111,
125000,
142857,
166667,
200000,
250000,
333333,
500000,
// Powers of two from 1s to 32s @ 50% precision
1000000, 2000000, 4000000, 8000000, 16000000, 32000000,
1000000,
2000000,
4000000,
8000000,
16000000,
32000000,
};

// ~50 UMA buckets with high precision from ~100 us to 1s.
const int kUMADurationBuckets[] = {
// Powers of 2 from 1 us to 64 us @ 50% precision.
1, 2, 4, 8, 16, 32, 64,
1,
2,
4,
8,
16,
32,
64,
// 1.25^20, 1.25^21, ..., 1.25^62 @ 20% precision.
87, 108, 136, 169, 212, 265, 331, 414, 517, 646, 808, 1010, 1262, 1578,
1972, 2465, 3081, 3852, 4815, 6019, 7523, 9404, 11755, 14694, 18367, 22959,
28699, 35873, 44842, 56052, 70065, 87581, 109476, 136846, 171057, 213821,
267276, 334096, 417619, 522024, 652530, 815663, 1019579,
87,
108,
136,
169,
212,
265,
331,
414,
517,
646,
808,
1010,
1262,
1578,
1972,
2465,
3081,
3852,
4815,
6019,
7523,
9404,
11755,
14694,
18367,
22959,
28699,
35873,
44842,
56052,
70065,
87581,
109476,
136846,
171057,
213821,
267276,
334096,
417619,
522024,
652530,
815663,
1019579,
// Powers of 2 from 2s to 32s @ 50% precision.
2000000, 4000000, 8000000, 16000000, 32000000,
2000000,
4000000,
8000000,
16000000,
32000000,
};

#define UMA_HISTOGRAM_CUSTOM_TIMES_VSYNC_ALIGNED(name, sample) \
Expand Down Expand Up @@ -824,13 +959,12 @@ void CompositorTimingHistory::DrawAborted() {
active_tree_main_frame_time_ = base::TimeTicks();
}

void CompositorTimingHistory::DidDraw(
bool used_new_active_tree,
base::TimeTicks impl_frame_time,
size_t composited_animations_count,
size_t main_thread_animations_count,
bool current_frame_had_raf,
bool next_frame_has_pending_raf) {
void CompositorTimingHistory::DidDraw(bool used_new_active_tree,
base::TimeTicks impl_frame_time,
size_t composited_animations_count,
size_t main_thread_animations_count,
bool current_frame_had_raf,
bool next_frame_has_pending_raf) {
DCHECK_NE(base::TimeTicks(), draw_start_time_);
base::TimeTicks draw_end_time = Now();
base::TimeDelta draw_duration = draw_end_time - draw_start_time_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CC_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_
#define CC_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_
#ifndef CC_METRICS_COMPOSITOR_TIMING_HISTORY_H_
#define CC_METRICS_COMPOSITOR_TIMING_HISTORY_H_

#include <memory>

Expand Down Expand Up @@ -180,4 +180,4 @@ class CC_EXPORT CompositorTimingHistory {

} // namespace cc

#endif // CC_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_
#endif // CC_METRICS_COMPOSITOR_TIMING_HISTORY_H_
Loading

0 comments on commit 5fb48ea

Please sign in to comment.