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

Side by Side Diff: ios/chrome/browser/desktop_promotion/histogram_macros.h

Issue 2643723004: Add Desktop iOS promotion logging to chrome ios app. (Closed)
Patch Set: browser_state keyed service Created 3 years, 10 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
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 IOS_CHROME_BROWSER_DESKTOP_PROMOTION_HISTOGRAM_MACROS_H_
6 #define IOS_CHROME_BROWSER_DESKTOP_PROMOTION_HISTOGRAM_MACROS_H_
7
8 #include "base/metrics/histogram.h"
9
10 // HISTOGRAM_POINTER_BLOCK differ from STATIC_HISTOGRAM_POINTER_BLOCK
11 // on using static histogram pointer, in this one we create a new histogram
12 // from the histogram_factory_get_invocation each time this is called.
13 // This is needed on the desktop promotion logging as there are cases where the
14 // same call will be trying to log different histogram names.
15 #define HISTOGRAM_POINTER_BLOCK(constant_histogram_name, \
16 histogram_add_method_invocation, \
17 histogram_factory_get_invocation) \
18 do { \
19 base::HistogramBase* histogram_pointer = histogram_factory_get_invocation; \
20 histogram_pointer->histogram_add_method_invocation; \
21 } while (0)
22
23 // This UMA_HISTOGRAM_CUSTOM_COUNT_NO_CACHE uses the HISTOGRAM_POINTER_BLOCK
24 // instead of STATIC_HISTOGRAM_POINTER_BLOCK which handles being called with
25 // different names from same function.
26 #define UMA_HISTOGRAM_CUSTOM_COUNT_NO_CACHE(name, sample, min, max, \
27 bucket_count) \
28 HISTOGRAM_POINTER_BLOCK(name, Add(sample), \
29 base::Histogram::FactoryGet( \
30 name, min, max, bucket_count, \
31 base::HistogramBase::kUmaTargetedHistogramFlag))
32
33 // Count histogram with no caching. This is used for collecting numeric data
34 // when the number of buckets is 50 and the max value doesn't exceed 1000.
35 #define UMA_HISTOGRAM_COUNT_1000_NO_CACHE(name, sample) \
36 UMA_HISTOGRAM_CUSTOM_COUNT_NO_CACHE(name, sample, 1, 1000, 50)
37
38 #endif // IOS_CHROME_BROWSER_DESKTOP_PROMOTION_HISTOGRAM_MACROS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698