OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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_UI_FIRST_RUN_FIRST_RUN_HISTOGRAMS_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_FIRST_RUN_FIRST_RUN_HISTOGRAMS_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 first run because the same funciton try to log |
| 14 // different histogram names, also we don't need static histogram as first run |
| 15 // logging only happens once (may be little more in some cases). |
| 16 #define HISTOGRAM_POINTER_BLOCK(constant_histogram_name, \ |
| 17 histogram_add_method_invocation, \ |
| 18 histogram_factory_get_invocation) \ |
| 19 do { \ |
| 20 base::HistogramBase* histogram_pointer = histogram_factory_get_invocation; \ |
| 21 histogram_pointer->histogram_add_method_invocation; \ |
| 22 } while (0) |
| 23 |
| 24 // This UMA_HISTOGRAM_CUSTOM_TIMES_FIRST_RUN uses the HISTOGRAM_POINTER_BLOCK |
| 25 // instead of STATIC_HISTOGRAM_POINTER_BLOCK which handles being called with |
| 26 // different names from same function. |
| 27 #define UMA_HISTOGRAM_CUSTOM_TIMES_FIRST_RUN(name, sample, min, max, \ |
| 28 bucket_count) \ |
| 29 HISTOGRAM_POINTER_BLOCK(name, AddTime(sample), \ |
| 30 base::Histogram::FactoryTimeGet( \ |
| 31 name, min, max, bucket_count, \ |
| 32 base::HistogramBase::kUmaTargetedHistogramFlag)) |
| 33 |
| 34 #endif // IOS_CHROME_BROWSER_UI_FIRST_RUN_FIRST_RUN_HISTOGRAMS_H_ |
OLD | NEW |