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

Side by Side Diff: ui/latency/latency_histogram_macros.h

Issue 2814483002: Splitting up RenderWidgetHostLatencyTracker and some renames. (Closed)
Patch Set: [Moving OnGpuSwapBuffersCompleted() back up. Created 3 years, 8 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 | « ui/latency/DEPS ('k') | ui/latency/latency_info.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
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 UI_LATENCY_LATENCY_HISTOGRAM_MACROS_H_
6 #define UI_LATENCY_LATENCY_HISTOGRAM_MACROS_H_
7
8 #include "base/metrics/histogram_functions.h"
9
10 // Check valid timing for start and end latency components.
11 #define CONFIRM_VALID_TIMING(start, end) \
12 DCHECK(!start.first_event_time.is_null()); \
13 DCHECK(!end.last_event_time.is_null()); \
14 DCHECK_GE(end.last_event_time, start.first_event_time);
15
16 // Event latency that is mostly under 1 second. We should only use 100 buckets
17 // when needed.
18 #define UMA_HISTOGRAM_INPUT_LATENCY_HIGH_RESOLUTION_MICROSECONDS(name, start, \
19 end) \
20 CONFIRM_VALID_TIMING(start, end) \
21 base::UmaHistogramCustomCounts( \
22 name, (end.last_event_time - start.first_event_time).InMicroseconds(), \
23 1, 1000000, 100);
24
25 #define UMA_HISTOGRAM_INPUT_LATENCY_MILLISECONDS(name, start, end) \
26 CONFIRM_VALID_TIMING(start, end) \
27 base::UmaHistogramCustomCounts( \
28 name, (end.last_event_time - start.first_event_time).InMilliseconds(), \
29 1, 1000, 50);
30
31 // Long touch/wheel scroll latency component that is mostly under 200ms.
32 #define UMA_HISTOGRAM_SCROLL_LATENCY_LONG_2(name, start, end) \
33 CONFIRM_VALID_TIMING(start, end) \
34 base::Histogram::FactoryGet(name, 1000, 200000, 50, \
35 base::HistogramBase::kUmaTargetedHistogramFlag) \
36 ->Add((end.last_event_time - start.first_event_time).InMicroseconds());
37
38 // Short touch/wheel scroll latency component that is mostly under 50ms.
39 #define UMA_HISTOGRAM_SCROLL_LATENCY_SHORT_2(name, start, end) \
40 CONFIRM_VALID_TIMING(start, end) \
41 base::Histogram::FactoryGet(name, 1, 50000, 50, \
42 base::HistogramBase::kUmaTargetedHistogramFlag) \
43 ->Add((end.last_event_time - start.first_event_time).InMicroseconds());
44
45 #endif // UI_LATENCY_LATENCY_HISTOGRAM_MACROS_H_
OLDNEW
« no previous file with comments | « ui/latency/DEPS ('k') | ui/latency/latency_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698