[M108 Migration][VD] Avoid pending frame counter becoming negative
[platform/framework/web/chromium-efl.git] / cc / metrics / ukm_smoothness_data.h
1 // Copyright 2020 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CC_METRICS_UKM_SMOOTHNESS_DATA_H_
6 #define CC_METRICS_UKM_SMOOTHNESS_DATA_H_
7
8 #include "base/time/time.h"
9 #include "cc/cc_export.h"
10 #include "cc/metrics/shared_metrics_buffer.h"
11
12 namespace cc {
13
14 // The smoothness metrics, containing the score measured using various
15 // normalization strategies. The normalization strategies are detailed in
16 // https://docs.google.com/document/d/1ENJXn2bPqvxycnVS9X35qDu1642DQyz42upj5ETOhSs/preview
17 struct CC_EXPORT UkmSmoothnessData {
18   UkmSmoothnessData();
19
20   double avg_smoothness = 0.0;
21   double worst_smoothness = 0.0;
22   double median_smoothness = 0.0;
23
24   // Values are set to -1 to help with recognizing when these metrics are not
25   // calculated.
26   double worst_smoothness_after1sec = -1.0;
27   double worst_smoothness_after2sec = -1.0;
28   double worst_smoothness_after5sec = -1.0;
29
30   double above_threshold = 0.0;
31   double percentile_95 = 0.0;
32   double variance = 0.0;
33   double buckets[7] = {0};
34
35   double scroll_focused_median = 0.0;
36   double scroll_focused_percentile_95 = 0.0;
37   double scroll_focused_variance = 0.0;
38
39   double main_focused_median = 0.0;
40   double main_focused_percentile_95 = 0.0;
41   double main_focused_variance = 0.0;
42
43   double compositor_focused_median = 0.0;
44   double compositor_focused_percentile_95 = 0.0;
45   double compositor_focused_variance = 0.0;
46 };
47
48 using UkmSmoothnessDataShared = SharedMetricsBuffer<UkmSmoothnessData>;
49
50 }  // namespace cc
51
52 #endif  // CC_METRICS_UKM_SMOOTHNESS_DATA_H_