diff options
39 files changed, 130 insertions, 261 deletions
diff --git a/base/metrics/field_trial.h b/base/metrics/field_trial.h index 51177eb..25ee0c1 100644 --- a/base/metrics/field_trial.h +++ b/base/metrics/field_trial.h @@ -24,7 +24,7 @@ // the impact of some pruning algorithm. // We assume that we already have a histogram of memory usage, such as: -// HISTOGRAM_COUNTS("Memory.RendererTotal", count); +// UMA_HISTOGRAM_COUNTS("Memory.RendererTotal", count); // Somewhere in main thread initialization code, we'd probably define an // instance of a FieldTrial, with code such as: diff --git a/base/metrics/histogram.cc b/base/metrics/histogram.cc index beb9b9e..6e30892 100644 --- a/base/metrics/histogram.cc +++ b/base/metrics/histogram.cc @@ -132,14 +132,6 @@ HistogramBase* Histogram::FactoryTimeGet(const string& name, bucket_count, flags); } -TimeTicks Histogram::DebugNow() { -#ifndef NDEBUG - return TimeTicks::Now(); -#else - return TimeTicks(); -#endif -} - // Calculate what range of values are held in each bucket. // We have to be careful that we don't pick a ratio between starting points in // consecutive buckets that is sooo small, that the integer bounds are the same diff --git a/base/metrics/histogram.h b/base/metrics/histogram.h index b795a12..816458d 100644 --- a/base/metrics/histogram.h +++ b/base/metrics/histogram.h @@ -98,7 +98,7 @@ class Lock; // The following code is generally what a thread-safe static pointer // initialization looks like for a histogram (after a macro is expanded). This // sample is an expansion (with comments) of the code for -// HISTOGRAM_CUSTOM_COUNTS(). +// LOCAL_HISTOGRAM_CUSTOM_COUNTS(). /* do { @@ -165,27 +165,27 @@ class Lock; // Provide easy general purpose histogram in a macro, just like stats counters. // The first four macros use 50 buckets. -#define HISTOGRAM_TIMES(name, sample) HISTOGRAM_CUSTOM_TIMES( \ +#define LOCAL_HISTOGRAM_TIMES(name, sample) LOCAL_HISTOGRAM_CUSTOM_TIMES( \ name, sample, base::TimeDelta::FromMilliseconds(1), \ base::TimeDelta::FromSeconds(10), 50) // For folks that need real specific times, use this to select a precise range // of times you want plotted, and the number of buckets you want used. -#define HISTOGRAM_CUSTOM_TIMES(name, sample, min, max, bucket_count) \ +#define LOCAL_HISTOGRAM_CUSTOM_TIMES(name, sample, min, max, bucket_count) \ STATIC_HISTOGRAM_POINTER_BLOCK(name, AddTime(sample), \ base::Histogram::FactoryTimeGet(name, min, max, bucket_count, \ base::HistogramBase::kNoFlags)) -#define HISTOGRAM_COUNTS(name, sample) HISTOGRAM_CUSTOM_COUNTS( \ +#define LOCAL_HISTOGRAM_COUNTS(name, sample) LOCAL_HISTOGRAM_CUSTOM_COUNTS( \ name, sample, 1, 1000000, 50) -#define HISTOGRAM_COUNTS_100(name, sample) HISTOGRAM_CUSTOM_COUNTS( \ - name, sample, 1, 100, 50) +#define LOCAL_HISTOGRAM_COUNTS_100(name, sample) \ + LOCAL_HISTOGRAM_CUSTOM_COUNTS(name, sample, 1, 100, 50) -#define HISTOGRAM_COUNTS_10000(name, sample) HISTOGRAM_CUSTOM_COUNTS( \ - name, sample, 1, 10000, 50) +#define LOCAL_HISTOGRAM_COUNTS_10000(name, sample) \ + LOCAL_HISTOGRAM_CUSTOM_COUNTS(name, sample, 1, 10000, 50) -#define HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) \ +#define LOCAL_HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) \ STATIC_HISTOGRAM_POINTER_BLOCK(name, Add(sample), \ base::Histogram::FactoryGet(name, min, max, bucket_count, \ base::HistogramBase::kNoFlags)) @@ -196,10 +196,10 @@ class Lock; base::LinearHistogram::FactoryGet(name, 1, boundary, boundary + 1, \ flag)) -#define HISTOGRAM_PERCENTAGE(name, under_one_hundred) \ - HISTOGRAM_ENUMERATION(name, under_one_hundred, 101) +#define LOCAL_HISTOGRAM_PERCENTAGE(name, under_one_hundred) \ + LOCAL_HISTOGRAM_ENUMERATION(name, under_one_hundred, 101) -#define HISTOGRAM_BOOLEAN(name, sample) \ +#define LOCAL_HISTOGRAM_BOOLEAN(name, sample) \ STATIC_HISTOGRAM_POINTER_BLOCK(name, AddBoolean(sample), \ base::BooleanHistogram::FactoryGet(name, base::Histogram::kNoFlags)) @@ -209,7 +209,7 @@ class Lock; // also that, despite explicitly setting the minimum bucket value to |1| below, // it is fine for enumerated histograms to be 0-indexed -- this is because // enumerated histograms should never have underflow. -#define HISTOGRAM_ENUMERATION(name, sample, boundary_value) \ +#define LOCAL_HISTOGRAM_ENUMERATION(name, sample, boundary_value) \ STATIC_HISTOGRAM_POINTER_BLOCK(name, Add(sample), \ base::LinearHistogram::FactoryGet(name, 1, boundary_value, \ boundary_value + 1, base::HistogramBase::kNoFlags)) @@ -219,82 +219,15 @@ class Lock; // CustomRanges::FactoryGet about the requirement of |custom_ranges|. // You can use the helper function CustomHistogram::ArrayToCustomRanges to // transform a C-style array of valid sample values to a std::vector<int>. -#define HISTOGRAM_CUSTOM_ENUMERATION(name, sample, custom_ranges) \ +#define LOCAL_HISTOGRAM_CUSTOM_ENUMERATION(name, sample, custom_ranges) \ STATIC_HISTOGRAM_POINTER_BLOCK(name, Add(sample), \ base::CustomHistogram::FactoryGet(name, custom_ranges, \ base::HistogramBase::kNoFlags)) -#define HISTOGRAM_MEMORY_KB(name, sample) HISTOGRAM_CUSTOM_COUNTS( \ +#define LOCAL_HISTOGRAM_MEMORY_KB(name, sample) LOCAL_HISTOGRAM_CUSTOM_COUNTS( \ name, sample, 1000, 500000, 50) //------------------------------------------------------------------------------ -// Define Debug vs non-debug flavors of macros. -#ifndef NDEBUG - -#define DHISTOGRAM_TIMES(name, sample) HISTOGRAM_TIMES(name, sample) -#define DHISTOGRAM_COUNTS(name, sample) HISTOGRAM_COUNTS(name, sample) -#define DHISTOGRAM_PERCENTAGE(name, under_one_hundred) HISTOGRAM_PERCENTAGE(\ - name, under_one_hundred) -#define DHISTOGRAM_CUSTOM_TIMES(name, sample, min, max, bucket_count) \ - HISTOGRAM_CUSTOM_TIMES(name, sample, min, max, bucket_count) -#define DHISTOGRAM_CLIPPED_TIMES(name, sample, min, max, bucket_count) \ - HISTOGRAM_CLIPPED_TIMES(name, sample, min, max, bucket_count) -#define DHISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) \ - HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) -#define DHISTOGRAM_ENUMERATION(name, sample, boundary_value) \ - HISTOGRAM_ENUMERATION(name, sample, boundary_value) -#define DHISTOGRAM_CUSTOM_ENUMERATION(name, sample, custom_ranges) \ - HISTOGRAM_CUSTOM_ENUMERATION(name, sample, custom_ranges) - -#else // NDEBUG -// Keep a mention of passed variables to avoid unused variable warnings in -// release build if these variables are only used in macros. -#define DISCARD_2_ARGUMENTS(a, b) \ - while (0) { \ - static_cast<void>(a); \ - static_cast<void>(b); \ - } -#define DISCARD_3_ARGUMENTS(a, b, c) \ - while (0) { \ - static_cast<void>(a); \ - static_cast<void>(b); \ - static_cast<void>(c); \ - } -#define DISCARD_5_ARGUMENTS(a, b, c, d ,e) \ - while (0) { \ - static_cast<void>(a); \ - static_cast<void>(b); \ - static_cast<void>(c); \ - static_cast<void>(d); \ - static_cast<void>(e); \ - } -#define DHISTOGRAM_TIMES(name, sample) \ - DISCARD_2_ARGUMENTS(name, sample) - -#define DHISTOGRAM_COUNTS(name, sample) \ - DISCARD_2_ARGUMENTS(name, sample) - -#define DHISTOGRAM_PERCENTAGE(name, under_one_hundred) \ - DISCARD_2_ARGUMENTS(name, under_one_hundred) - -#define DHISTOGRAM_CUSTOM_TIMES(name, sample, min, max, bucket_count) \ - DISCARD_5_ARGUMENTS(name, sample, min, max, bucket_count) - -#define DHISTOGRAM_CLIPPED_TIMES(name, sample, min, max, bucket_count) \ - DISCARD_5_ARGUMENTS(name, sample, min, max, bucket_count) - -#define DHISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) \ - DISCARD_5_ARGUMENTS(name, sample, min, max, bucket_count) - -#define DHISTOGRAM_ENUMERATION(name, sample, boundary_value) \ - DISCARD_3_ARGUMENTS(name, sample, boundary_value) - -#define DHISTOGRAM_CUSTOM_ENUMERATION(name, sample, custom_ranges) \ - DISCARD_3_ARGUMENTS(name, sample, custom_ranges) - -#endif // NDEBUG - -//------------------------------------------------------------------------------ // The following macros provide typical usage scenarios for callers that wish // to record histogram data, and have the data submitted/uploaded via UMA. // Not all systems support such UMA, but if they do, the following macros @@ -408,10 +341,6 @@ class BASE_EXPORT Histogram : public HistogramBase { size_t bucket_count, int32 flags); - // Time call for use with DHISTOGRAM*. - // Returns TimeTicks::Now() in debug and TimeTicks() in release build. - static TimeTicks DebugNow(); - static void InitializeBucketRanges(Sample minimum, Sample maximum, BucketRanges* ranges); @@ -660,7 +589,7 @@ class BASE_EXPORT CustomHistogram : public Histogram { virtual HistogramType GetHistogramType() const OVERRIDE; // Helper method for transforming an array of valid enumeration values - // to the std::vector<int> expected by HISTOGRAM_CUSTOM_ENUMERATION. + // to the std::vector<int> expected by UMA_HISTOGRAM_CUSTOM_ENUMERATION. // This function ensures that a guard bucket exists right after any // valid sample value (unless the next higher sample is also a valid value), // so that invalid samples never fall into the same bucket as valid samples. diff --git a/base/metrics/histogram_unittest.cc b/base/metrics/histogram_unittest.cc index 5fbd28a..41e36fa 100644 --- a/base/metrics/histogram_unittest.cc +++ b/base/metrics/histogram_unittest.cc @@ -65,20 +65,17 @@ TEST_F(HistogramTest, BasicTest) { EXPECT_TRUE(custom_histogram); // Use standard macros (but with fixed samples) - HISTOGRAM_TIMES("Test2Histogram", TimeDelta::FromDays(1)); - HISTOGRAM_COUNTS("Test3Histogram", 30); + LOCAL_HISTOGRAM_TIMES("Test2Histogram", TimeDelta::FromDays(1)); + LOCAL_HISTOGRAM_COUNTS("Test3Histogram", 30); - DHISTOGRAM_TIMES("Test4Histogram", TimeDelta::FromDays(1)); - DHISTOGRAM_COUNTS("Test5Histogram", 30); - - HISTOGRAM_ENUMERATION("Test6Histogram", 129, 130); + LOCAL_HISTOGRAM_ENUMERATION("Test6Histogram", 129, 130); } // Check that the macro correctly matches histograms by name and records their // data together. TEST_F(HistogramTest, NameMatchTest) { - HISTOGRAM_PERCENTAGE("DuplicatedHistogram", 10); - HISTOGRAM_PERCENTAGE("DuplicatedHistogram", 10); + LOCAL_HISTOGRAM_PERCENTAGE("DuplicatedHistogram", 10); + LOCAL_HISTOGRAM_PERCENTAGE("DuplicatedHistogram", 10); HistogramBase* histogram = LinearHistogram::FactoryGet( "DuplicatedHistogram", 1, 101, 102, HistogramBase::kNoFlags); diff --git a/base/metrics/sparse_histogram.h b/base/metrics/sparse_histogram.h index 07d5660..c114916 100644 --- a/base/metrics/sparse_histogram.h +++ b/base/metrics/sparse_histogram.h @@ -19,39 +19,13 @@ namespace base { -// The common code for different SparseHistogram macros. -#define HISTOGRAM_SPARSE_COMMON(name, sample, flag) \ +#define UMA_HISTOGRAM_SPARSE_SLOWLY(name, sample) \ do { \ - base::HistogramBase* histogram( \ - base::SparseHistogram::FactoryGet(name, flag)); \ - DCHECK_EQ(histogram->histogram_name(), name); \ + base::HistogramBase* histogram = base::SparseHistogram::FactoryGet( \ + name, base::HistogramBase::kUmaTargetedHistogramFlag); \ histogram->Add(sample); \ } while (0) -#define HISTOGRAM_SPARSE_SLOWLY(name, sample) \ - HISTOGRAM_SPARSE_COMMON(name, sample, base::HistogramBase::kNoFlags) - -#define UMA_HISTOGRAM_SPARSE_SLOWLY(name, sample) \ - HISTOGRAM_SPARSE_COMMON(name, sample, \ - base::HistogramBase::kUmaTargetedHistogramFlag) - -//------------------------------------------------------------------------------ -// Define debug only version of macros. -#ifndef NDEBUG - -#define DHISTOGRAM_SPARSE_SLOWLY(name, sample) \ - HISTOGRAM_SPARSE_SLOWLY(name, sample) - -#else // NDEBUG - -#define DHISTOGRAM_SPARSE_SLOWLY(name, sample) \ - while (0) { \ - static_cast<void>(name); \ - static_cast<void>(sample); \ - } - -#endif // NDEBUG - class HistogramSamples; class BASE_EXPORT_PRIVATE SparseHistogram : public HistogramBase { diff --git a/base/metrics/sparse_histogram_unittest.cc b/base/metrics/sparse_histogram_unittest.cc index 825381d..6a0efa4 100644 --- a/base/metrics/sparse_histogram_unittest.cc +++ b/base/metrics/sparse_histogram_unittest.cc @@ -64,9 +64,9 @@ TEST_F(SparseHistogramTest, BasicTest) { } TEST_F(SparseHistogramTest, MacroBasicTest) { - HISTOGRAM_SPARSE_SLOWLY("Sparse", 100); - HISTOGRAM_SPARSE_SLOWLY("Sparse", 200); - HISTOGRAM_SPARSE_SLOWLY("Sparse", 100); + UMA_HISTOGRAM_SPARSE_SLOWLY("Sparse", 100); + UMA_HISTOGRAM_SPARSE_SLOWLY("Sparse", 200); + UMA_HISTOGRAM_SPARSE_SLOWLY("Sparse", 100); StatisticsRecorder::Histograms histograms; StatisticsRecorder::GetHistograms(&histograms); @@ -76,7 +76,8 @@ TEST_F(SparseHistogramTest, MacroBasicTest) { EXPECT_EQ(SPARSE_HISTOGRAM, sparse_histogram->GetHistogramType()); EXPECT_EQ("Sparse", sparse_histogram->histogram_name()); - EXPECT_EQ(HistogramBase::kNoFlags, sparse_histogram->flags()); + EXPECT_EQ(HistogramBase::kUmaTargetedHistogramFlag, + sparse_histogram->flags()); scoped_ptr<HistogramSamples> samples = sparse_histogram->SnapshotSamples(); EXPECT_EQ(3, samples->TotalCount()); @@ -84,20 +85,6 @@ TEST_F(SparseHistogramTest, MacroBasicTest) { EXPECT_EQ(1, samples->GetCount(200)); } -TEST_F(SparseHistogramTest, MacroUmaTest) { - UMA_HISTOGRAM_SPARSE_SLOWLY("Uma", 100); - - StatisticsRecorder::Histograms histograms; - StatisticsRecorder::GetHistograms(&histograms); - - ASSERT_EQ(1U, histograms.size()); - HistogramBase* sparse_histogram = histograms[0]; - - EXPECT_EQ("Uma", sparse_histogram->histogram_name()); - EXPECT_EQ(HistogramBase::kUmaTargetedHistogramFlag, - sparse_histogram->flags()); -} - TEST_F(SparseHistogramTest, MacroInLoopTest) { // Unlike the macros in histogram.h, SparseHistogram macros can have a // variable as histogram name. diff --git a/base/metrics/statistics_recorder_unittest.cc b/base/metrics/statistics_recorder_unittest.cc index 906e642..cabeb71 100644 --- a/base/metrics/statistics_recorder_unittest.cc +++ b/base/metrics/statistics_recorder_unittest.cc @@ -222,29 +222,18 @@ TEST_F(StatisticsRecorderTest, RegisterHistogramWithMacros) { "TestHistogramCounts", 1, 1000000, 50, HistogramBase::kNoFlags); // The histogram we got from macro is the same as from FactoryGet. - HISTOGRAM_COUNTS("TestHistogramCounts", 30); + LOCAL_HISTOGRAM_COUNTS("TestHistogramCounts", 30); registered_histograms.clear(); StatisticsRecorder::GetHistograms(®istered_histograms); ASSERT_EQ(1u, registered_histograms.size()); EXPECT_EQ(histogram, registered_histograms[0]); - HISTOGRAM_TIMES("TestHistogramTimes", TimeDelta::FromDays(1)); - HISTOGRAM_ENUMERATION("TestHistogramEnumeration", 20, 200); + LOCAL_HISTOGRAM_TIMES("TestHistogramTimes", TimeDelta::FromDays(1)); + LOCAL_HISTOGRAM_ENUMERATION("TestHistogramEnumeration", 20, 200); registered_histograms.clear(); StatisticsRecorder::GetHistograms(®istered_histograms); EXPECT_EQ(3u, registered_histograms.size()); - - // Debugging only macros. - DHISTOGRAM_TIMES("TestHistogramDebugTimes", TimeDelta::FromDays(1)); - DHISTOGRAM_COUNTS("TestHistogramDebugCounts", 30); - registered_histograms.clear(); - StatisticsRecorder::GetHistograms(®istered_histograms); -#ifndef NDEBUG - EXPECT_EQ(5u, registered_histograms.size()); -#else - EXPECT_EQ(3u, registered_histograms.size()); -#endif } TEST_F(StatisticsRecorderTest, BucketRangesSharing) { @@ -266,10 +255,10 @@ TEST_F(StatisticsRecorderTest, BucketRangesSharing) { } TEST_F(StatisticsRecorderTest, ToJSON) { - HISTOGRAM_COUNTS("TestHistogram1", 30); - HISTOGRAM_COUNTS("TestHistogram1", 40); - HISTOGRAM_COUNTS("TestHistogram2", 30); - HISTOGRAM_COUNTS("TestHistogram2", 40); + LOCAL_HISTOGRAM_COUNTS("TestHistogram1", 30); + LOCAL_HISTOGRAM_COUNTS("TestHistogram1", 40); + LOCAL_HISTOGRAM_COUNTS("TestHistogram2", 30); + LOCAL_HISTOGRAM_COUNTS("TestHistogram2", 40); std::string json(StatisticsRecorder::ToJSON(std::string())); diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc index 0dcdd79..c9a9e3a 100644 --- a/cc/resources/tile_manager.cc +++ b/cc/resources/tile_manager.cc @@ -152,7 +152,7 @@ class RasterTaskImpl : public RasterTask { if (rendering_stats_->record_rendering_stats()) { base::TimeDelta current_rasterize_time = rendering_stats_->impl_thread_rendering_stats().rasterize_time; - HISTOGRAM_CUSTOM_COUNTS( + LOCAL_HISTOGRAM_CUSTOM_COUNTS( "Renderer4.PictureRasterTimeUS", (current_rasterize_time - prev_rasterize_time).InMicroseconds(), 0, diff --git a/chrome/browser/chrome_browser_main_mac.mm b/chrome/browser/chrome_browser_main_mac.mm index ecfd602..dd7c32f 100644 --- a/chrome/browser/chrome_browser_main_mac.mm +++ b/chrome/browser/chrome_browser_main_mac.mm @@ -137,9 +137,9 @@ CatSixtyFour CatSixtyFourValue() { void RecordCatSixtyFour() { CatSixtyFour cat_sixty_four = CatSixtyFourValue(); - // Set this higher than the highest value in the CatSixtyFour enum to - // provide some headroom and then leave it alone. See HISTOGRAM_ENUMERATION - // in base/metrics/histogram.h. + // Set this higher than the highest value in the CatSixtyFour enum to provide + // some headroom and then leave it alone. See UMA_HISTOGRAM_ENUMERATION in + // base/metrics/histogram.h. const int kMaxCatsAndSixtyFours = 32; COMPILE_ASSERT(kMaxCatsAndSixtyFours >= CAT_SIXTY_FOUR_MAX, CatSixtyFour_enum_grew_too_large); diff --git a/chrome/browser/chromeos/memory/oom_priority_manager.cc b/chrome/browser/chromeos/memory/oom_priority_manager.cc index a6d408c..b948da9 100644 --- a/chrome/browser/chromeos/memory/oom_priority_manager.cc +++ b/chrome/browser/chromeos/memory/oom_priority_manager.cc @@ -58,7 +58,7 @@ namespace chromeos { namespace { // Record a size in megabytes, over a potential interval up to 32 GB. -#define HISTOGRAM_MEGABYTES(name, sample) \ +#define UMA_HISTOGRAM_MEGABYTES(name, sample) \ UMA_HISTOGRAM_CUSTOM_COUNTS(name, sample, 1, 32768, 50) // The default interval in seconds after which to adjust the oom_score_adj @@ -356,7 +356,7 @@ void OomPriorityManager::RecordDiscardStatistics() { // not have sufficient resolution in the 2-4 GB range and does not properly // account for graphics memory on ARM. Replace with MemAllocatedMB below. int mem_anonymous_mb = (memory.active_anon + memory.inactive_anon) / 1024; - HISTOGRAM_MEGABYTES("Tabs.Discard.MemAnonymousMB", mem_anonymous_mb); + UMA_HISTOGRAM_MEGABYTES("Tabs.Discard.MemAnonymousMB", mem_anonymous_mb); // Record graphics GEM object size in a histogram with 50 MB buckets. int mem_graphics_gem_mb = 0; @@ -380,7 +380,7 @@ void OomPriorityManager::RecordDiscardStatistics() { int mem_available_mb = (memory.active_file + memory.inactive_file + memory.free) / 1024; - HISTOGRAM_MEGABYTES("Tabs.Discard.MemAvailableMB", mem_available_mb); + UMA_HISTOGRAM_MEGABYTES("Tabs.Discard.MemAvailableMB", mem_available_mb); } // Set up to record the next interval. last_discard_time_ = TimeTicks::Now(); diff --git a/chrome/browser/extensions/external_registry_loader_win.cc b/chrome/browser/extensions/external_registry_loader_win.cc index d471a60..4a01f32 100644 --- a/chrome/browser/extensions/external_registry_loader_win.cc +++ b/chrome/browser/extensions/external_registry_loader_win.cc @@ -181,8 +181,8 @@ void ExternalRegistryLoader::LoadOnFileThread() { } prefs_.reset(prefs.release()); - HISTOGRAM_TIMES("Extensions.ExternalRegistryLoaderWin", - base::TimeTicks::Now() - start_time); + LOCAL_HISTOGRAM_TIMES("Extensions.ExternalRegistryLoaderWin", + base::TimeTicks::Now() - start_time); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::Bind(&ExternalRegistryLoader::LoadFinished, this)); diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc index 714c48a..46d3a3c 100644 --- a/chrome/browser/history/history_backend.cc +++ b/chrome/browser/history/history_backend.cc @@ -702,8 +702,7 @@ void HistoryBackend::InitImpl(const std::string& languages) { } #endif - HISTOGRAM_TIMES("History.InitTime", - TimeTicks::Now() - beginning_time); + LOCAL_HISTOGRAM_TIMES("History.InitTime", TimeTicks::Now() - beginning_time); } void HistoryBackend::OnMemoryPressure( @@ -1596,8 +1595,8 @@ void HistoryBackend::GetLargestFaviconForURL( if (bitmap_result.is_valid()) *favicon_bitmap_result = bitmap_result; - HISTOGRAM_TIMES("History.GetLargestFaviconForURL", - TimeTicks::Now() - beginning_time); + LOCAL_HISTOGRAM_TIMES("History.GetLargestFaviconForURL", + TimeTicks::Now() - beginning_time); } void HistoryBackend::GetFaviconsForURL( diff --git a/chrome/browser/metrics/chrome_stability_metrics_provider.cc b/chrome/browser/metrics/chrome_stability_metrics_provider.cc index 7f669eb..fbe79a6 100644 --- a/chrome/browser/metrics/chrome_stability_metrics_provider.cc +++ b/chrome/browser/metrics/chrome_stability_metrics_provider.cc @@ -187,7 +187,8 @@ void ChromeStabilityMetricsProvider::BrowserChildProcessCrashed( void ChromeStabilityMetricsProvider::LogLoadStarted( content::WebContents* web_contents) { content::RecordAction(base::UserMetricsAction("PageLoad")); - HISTOGRAM_ENUMERATION("Chrome.UmaPageloadCounter", 1, 2); + // TODO(asvitkine): Check if this is used for anything and if not, remove. + LOCAL_HISTOGRAM_BOOLEAN("Chrome.UmaPageloadCounter", true); IncrementPrefValue(prefs::kStabilityPageLoadCount); IncrementLongPrefsValue(prefs::kUninstallMetricsPageLoadCount); // We need to save the prefs, as page load count is a critical stat, and it diff --git a/chrome/browser/net/evicted_domain_cookie_counter.cc b/chrome/browser/net/evicted_domain_cookie_counter.cc index 28fa6a4..abf44af 100644 --- a/chrome/browser/net/evicted_domain_cookie_counter.cc +++ b/chrome/browser/net/evicted_domain_cookie_counter.cc @@ -41,7 +41,7 @@ void DelegateImpl::Report( const Time& reinstatement_time) { TimeDelta reinstatement_delay( reinstatement_time - evicted_cookie.eviction_time); - // Need to duplicate HISTOGRAM_CUSTOM_TIMES(), since it is a macro that + // Need to duplicate UMA_HISTOGRAM_CUSTOM_TIMES(), since it is a macro that // defines a static variable. if (evicted_cookie.is_google) { UMA_HISTOGRAM_CUSTOM_TIMES("Cookie.ReinstatedCookiesGoogle", diff --git a/chrome/browser/net/network_stats.h b/chrome/browser/net/network_stats.h index ff17df5..4ce6c4e 100644 --- a/chrome/browser/net/network_stats.h +++ b/chrome/browser/net/network_stats.h @@ -55,7 +55,7 @@ namespace chrome_browser_net { class NetworkStats { public: - enum Status { // Used in HISTOGRAM_ENUMERATION. + enum Status { // Used in UMA_HISTOGRAM_ENUMERATION. SUCCESS, // Successfully received bytes from the server. SOCKET_CREATE_FAILED, // Socket creation failed. RESOLVE_FAILED, // Host resolution failed. diff --git a/chrome/browser/net/url_info.cc b/chrome/browser/net/url_info.cc index 4069a2a..48ac54c 100644 --- a/chrome/browser/net/url_info.cc +++ b/chrome/browser/net/url_info.cc @@ -169,9 +169,11 @@ void UrlInfo::SetNoSuchNameState() { DCHECK(ASSIGNED == state_); state_ = NO_SUCH_NAME; resolve_duration_ = GetDuration(); +#ifndef NDEBUG if (MaxNonNetworkDnsLookupDuration() <= resolve_duration_) { - DHISTOGRAM_TIMES("DNS.PrefetchNotFoundName", resolve_duration_); + LOCAL_HISTOGRAM_TIMES("DNS.PrefetchNotFoundName", resolve_duration_); } +#endif sequence_number_ = sequence_counter++; DLogResultsStats("DNS PrefetchNotFound"); } diff --git a/chrome/browser/renderer_host/chrome_render_message_filter.cc b/chrome/browser/renderer_host/chrome_render_message_filter.cc index ef49c8e..0342a8b 100644 --- a/chrome/browser/renderer_host/chrome_render_message_filter.cc +++ b/chrome/browser/renderer_host/chrome_render_message_filter.cc @@ -114,16 +114,16 @@ void ChromeRenderMessageFilter::OnPreconnect(const GURL& url) { void ChromeRenderMessageFilter::OnResourceTypeStats( const WebCache::ResourceTypeStats& stats) { - HISTOGRAM_COUNTS("WebCoreCache.ImagesSizeKB", - static_cast<int>(stats.images.size / 1024)); - HISTOGRAM_COUNTS("WebCoreCache.CSSStylesheetsSizeKB", - static_cast<int>(stats.cssStyleSheets.size / 1024)); - HISTOGRAM_COUNTS("WebCoreCache.ScriptsSizeKB", - static_cast<int>(stats.scripts.size / 1024)); - HISTOGRAM_COUNTS("WebCoreCache.XSLStylesheetsSizeKB", - static_cast<int>(stats.xslStyleSheets.size / 1024)); - HISTOGRAM_COUNTS("WebCoreCache.FontsSizeKB", - static_cast<int>(stats.fonts.size / 1024)); + LOCAL_HISTOGRAM_COUNTS("WebCoreCache.ImagesSizeKB", + static_cast<int>(stats.images.size / 1024)); + LOCAL_HISTOGRAM_COUNTS("WebCoreCache.CSSStylesheetsSizeKB", + static_cast<int>(stats.cssStyleSheets.size / 1024)); + LOCAL_HISTOGRAM_COUNTS("WebCoreCache.ScriptsSizeKB", + static_cast<int>(stats.scripts.size / 1024)); + LOCAL_HISTOGRAM_COUNTS("WebCoreCache.XSLStylesheetsSizeKB", + static_cast<int>(stats.xslStyleSheets.size / 1024)); + LOCAL_HISTOGRAM_COUNTS("WebCoreCache.FontsSizeKB", + static_cast<int>(stats.fonts.size / 1024)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); #if defined(ENABLE_TASK_MANAGER) diff --git a/chrome/browser/safe_browsing/database_manager.cc b/chrome/browser/safe_browsing/database_manager.cc index 84b0942..92bf351 100644 --- a/chrome/browser/safe_browsing/database_manager.cc +++ b/chrome/browser/safe_browsing/database_manager.cc @@ -810,7 +810,7 @@ void SafeBrowsingDatabaseManager::DatabaseLoadComplete() { if (!enabled_) return; - HISTOGRAM_COUNTS("SB.QueueDepth", queued_checks_.size()); + LOCAL_HISTOGRAM_COUNTS("SB.QueueDepth", queued_checks_.size()); if (queued_checks_.empty()) return; @@ -820,7 +820,8 @@ void SafeBrowsingDatabaseManager::DatabaseLoadComplete() { while (!queued_checks_.empty()) { QueuedCheck check = queued_checks_.front(); DCHECK(!check.start.is_null()); - HISTOGRAM_TIMES("SB.QueueDelay", base::TimeTicks::Now() - check.start); + LOCAL_HISTOGRAM_TIMES("SB.QueueDelay", + base::TimeTicks::Now() - check.start); // If CheckUrl() determines the URL is safe immediately, it doesn't call the // client's handler function (because normally it's being directly called by // the client). Since we're not the client, we have to convey this result. diff --git a/chrome/browser/spellchecker/spellcheck_platform_mac.mm b/chrome/browser/spellchecker/spellcheck_platform_mac.mm index a5951ed..434c66f 100644 --- a/chrome/browser/spellchecker/spellcheck_platform_mac.mm +++ b/chrome/browser/spellchecker/spellcheck_platform_mac.mm @@ -13,7 +13,6 @@ #include "base/logging.h" #include "base/mac/foundation_util.h" #include "base/mac/scoped_nsexception_enabler.h" -#include "base/metrics/histogram.h" #include "base/strings/sys_string_conversions.h" #include "base/time/time.h" #include "chrome/common/spellcheck_common.h" @@ -197,12 +196,8 @@ bool CheckSpelling(const base::string16& word_to_check, int tag) { void FillSuggestionList(const base::string16& wrong_word, std::vector<base::string16>* optional_suggestions) { NSString* NS_wrong_word = base::SysUTF16ToNSString(wrong_word); - TimeTicks debug_begin_time = base::Histogram::DebugNow(); // The suggested words for |wrong_word|. NSArray* guesses = [SharedSpellChecker() guessesForWord:NS_wrong_word]; - DHISTOGRAM_TIMES("Spellcheck.SuggestTime", - base::Histogram::DebugNow() - debug_begin_time); - for (int i = 0; i < static_cast<int>([guesses count]); ++i) { if (i < chrome::spellcheck_common::kMaxSuggestions) { optional_suggestions->push_back(base::SysNSStringToUTF16( diff --git a/chrome/browser/sync_file_system/drive_backend/sync_engine.cc b/chrome/browser/sync_file_system/drive_backend/sync_engine.cc index bab91aa..999ef3c 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_engine.cc +++ b/chrome/browser/sync_file_system/drive_backend/sync_engine.cc @@ -161,7 +161,7 @@ void DidRegisterOrigin(const base::TimeTicks& start_time, const SyncStatusCallback& callback, SyncStatusCode status) { base::TimeDelta delta(base::TimeTicks::Now() - start_time); - HISTOGRAM_TIMES("SyncFileSystem.RegisterOriginTime", delta); + LOCAL_HISTOGRAM_TIMES("SyncFileSystem.RegisterOriginTime", delta); callback.Run(status); } diff --git a/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc b/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc index c4faa32..9d8b42b 100644 --- a/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc +++ b/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc @@ -179,9 +179,13 @@ void ContentBasedThumbnailingAlgorithm::CreateRetargetedThumbnail( thumbnail, thumbnail_size.width(), thumbnail_size.height()); } - HISTOGRAM_TIMES( - processing_failed ? kFailureHistogramName : kThumbnailHistogramName, - base::TimeTicks::Now() - begin_compute_thumbnail); + if (processing_failed) { + LOCAL_HISTOGRAM_TIMES(kFailureHistogramName, + base::TimeTicks::Now() - begin_compute_thumbnail); + } else { + LOCAL_HISTOGRAM_TIMES(kThumbnailHistogramName, + base::TimeTicks::Now() - begin_compute_thumbnail); + } context->score.boring_score = SimpleThumbnailCrop::CalculateBoringScore(source_bitmap); if (!processing_failed) diff --git a/chrome/browser/thumbnails/simple_thumbnail_crop.cc b/chrome/browser/thumbnails/simple_thumbnail_crop.cc index 28268bf..26a89f4 100644 --- a/chrome/browser/thumbnails/simple_thumbnail_crop.cc +++ b/chrome/browser/thumbnails/simple_thumbnail_crop.cc @@ -238,8 +238,8 @@ SkBitmap SimpleThumbnailCrop::CreateThumbnail(const SkBitmap& bitmap, clipped_bitmap.copyTo(&result, kN32_SkColorType); #endif - HISTOGRAM_TIMES(kThumbnailHistogramName, - base::TimeTicks::Now() - begin_compute_thumbnail); + LOCAL_HISTOGRAM_TIMES(kThumbnailHistogramName, + base::TimeTicks::Now() - begin_compute_thumbnail); return result; } diff --git a/chrome/browser/ui/omnibox/omnibox_edit_model.cc b/chrome/browser/ui/omnibox/omnibox_edit_model.cc index f910123..15a2235 100644 --- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc +++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc @@ -783,7 +783,7 @@ void OmniboxEditModel::OpenMatch(AutocompleteMatch match, chrome::NOTIFICATION_OMNIBOX_OPENED_URL, content::Source<Profile>(profile_), content::Details<OmniboxLog>(&log)); - HISTOGRAM_ENUMERATION("Omnibox.EventCount", 1, 2); + LOCAL_HISTOGRAM_BOOLEAN("Omnibox.EventCount", true); DCHECK(!last_omnibox_focus_.is_null()) << "An omnibox focus should have occurred before opening a match."; UMA_HISTOGRAM_TIMES(kFocusToOpenTimeHistogram, now - last_omnibox_focus_); diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index a6289cd..021c73d 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc @@ -918,7 +918,7 @@ bool BrowserView::IsFullscreenBubbleVisible() const { #if defined(OS_WIN) void BrowserView::SetMetroSnapMode(bool enable) { - HISTOGRAM_COUNTS("Metro.SnapModeToggle", enable); + LOCAL_HISTOGRAM_COUNTS("Metro.SnapModeToggle", enable); ProcessFullscreen(enable, METRO_SNAP_FULLSCREEN, GURL(), FEB_TYPE_NONE); } diff --git a/chrome/browser/ui/webui/ntp/new_tab_page_handler.cc b/chrome/browser/ui/webui/ntp/new_tab_page_handler.cc index e3131ce..4d16b74 100644 --- a/chrome/browser/ui/webui/ntp/new_tab_page_handler.cc +++ b/chrome/browser/ui/webui/ntp/new_tab_page_handler.cc @@ -35,8 +35,8 @@ NewTabPageHandler::NewTabPageHandler() : page_switch_count_(0) { } NewTabPageHandler::~NewTabPageHandler() { - HISTOGRAM_COUNTS_100("NewTabPage.SingleSessionPageSwitches", - page_switch_count_); + LOCAL_HISTOGRAM_COUNTS_100("NewTabPage.SingleSessionPageSwitches", + page_switch_count_); } void NewTabPageHandler::RegisterMessages() { diff --git a/chrome/renderer/spellchecker/hunspell_engine.cc b/chrome/renderer/spellchecker/hunspell_engine.cc index f8071ef..1b21b62 100644 --- a/chrome/renderer/spellchecker/hunspell_engine.cc +++ b/chrome/renderer/spellchecker/hunspell_engine.cc @@ -8,14 +8,12 @@ #include <iterator> #include "base/files/memory_mapped_file.h" -#include "base/metrics/histogram.h" #include "base/time/time.h" #include "chrome/common/spellcheck_common.h" #include "chrome/common/spellcheck_messages.h" #include "content/public/renderer/render_thread.h" #include "third_party/hunspell/src/hunspell/hunspell.hxx" -using base::TimeTicks; using content::RenderThread; namespace { @@ -63,12 +61,7 @@ void HunspellEngine::InitializeHunspell() { bdict_file_.reset(new base::MemoryMappedFile); if (bdict_file_->Initialize(file_.Pass())) { - TimeTicks debug_start_time = base::Histogram::DebugNow(); - hunspell_.reset(new Hunspell(bdict_file_->data(), bdict_file_->length())); - - DHISTOGRAM_TIMES("Spellcheck.InitTime", - base::Histogram::DebugNow() - debug_start_time); } else { NOTREACHED() << "Could not mmap spellchecker dictionary."; } diff --git a/components/startup_metric_utils/startup_metric_utils.cc b/components/startup_metric_utils/startup_metric_utils.cc index 46a70c4..255cc17 100644 --- a/components/startup_metric_utils/startup_metric_utils.cc +++ b/components/startup_metric_utils/startup_metric_utils.cc @@ -62,9 +62,9 @@ void RecordMainEntryTimeHistogram() { (browser_main_entry_time_raw_ms >> 1) & kLower31BitsMask); // A timestamp is a 64 bit value, yet histograms can only store 32 bits. - HISTOGRAM_TIMES("Startup.BrowserMainEntryTimeAbsoluteHighWord", + LOCAL_HISTOGRAM_TIMES("Startup.BrowserMainEntryTimeAbsoluteHighWord", browser_main_entry_time_raw_ms_high_word); - HISTOGRAM_TIMES("Startup.BrowserMainEntryTimeAbsoluteLowWord", + LOCAL_HISTOGRAM_TIMES("Startup.BrowserMainEntryTimeAbsoluteLowWord", browser_main_entry_time_raw_ms_low_word); } diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index d2a642c..79dd16e 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc @@ -329,7 +329,7 @@ class BrowserMainLoop::MemoryObserver : public base::MessageLoop::TaskObserver { #endif size_t private_bytes; process_metrics->GetMemoryBytes(&private_bytes, NULL); - HISTOGRAM_MEMORY_KB("Memory.BrowserUsed", private_bytes >> 10); + LOCAL_HISTOGRAM_MEMORY_KB("Memory.BrowserUsed", private_bytes >> 10); #endif } private: diff --git a/content/browser/plugin_loader_posix.cc b/content/browser/plugin_loader_posix.cc index 7b27881..22bc2b6 100644 --- a/content/browser/plugin_loader_posix.cc +++ b/content/browser/plugin_loader_posix.cc @@ -110,9 +110,9 @@ void PluginLoaderPosix::GetPluginsToLoad() { base::Bind(&PluginLoaderPosix::LoadPluginsInternal, make_scoped_refptr(this))); - HISTOGRAM_TIMES("PluginLoaderPosix.GetPluginList", - (base::TimeTicks::Now() - start_time) * - base::Time::kMicrosecondsPerMillisecond); + LOCAL_HISTOGRAM_TIMES("PluginLoaderPosix.GetPluginList", + (base::TimeTicks::Now() - start_time) * + base::Time::kMicrosecondsPerMillisecond); } void PluginLoaderPosix::LoadPluginsInternal() { @@ -209,9 +209,9 @@ bool PluginLoaderPosix::MaybeRunPendingCallbacks() { } callbacks_.clear(); - HISTOGRAM_TIMES("PluginLoaderPosix.LoadDone", - (base::TimeTicks::Now() - load_start_time_) - * base::Time::kMicrosecondsPerMillisecond); + LOCAL_HISTOGRAM_TIMES("PluginLoaderPosix.LoadDone", + (base::TimeTicks::Now() - load_start_time_) * + base::Time::kMicrosecondsPerMillisecond); load_start_time_ = base::TimeTicks(); return true; diff --git a/content/browser/renderer_host/input/input_router_impl.cc b/content/browser/renderer_host/input/input_router_impl.cc index a509465..441f938 100644 --- a/content/browser/renderer_host/input/input_router_impl.cc +++ b/content/browser/renderer_host/input/input_router_impl.cc @@ -150,8 +150,8 @@ void InputRouterImpl::SendWheelEvent(const QueuedWheelEvent& wheel_event) { mouse_wheel_pending_ = true; current_wheel_event_ = wheel_event; - HISTOGRAM_COUNTS_100("Renderer.WheelQueueSize", - coalesced_mouse_wheel_events_.size()); + LOCAL_HISTOGRAM_COUNTS_100("Renderer.WheelQueueSize", + coalesced_mouse_wheel_events_.size()); FilterAndSendWebInputEvent( wheel_event.event.event, wheel_event.event.latency, false); @@ -164,7 +164,7 @@ void InputRouterImpl::SendKeyboardEvent(const NativeWebKeyboardEvent& key_event, // renderer and we need to give something to the HandleKeyboardEvent // handler. key_queue_.push_back(key_event); - HISTOGRAM_COUNTS_100("Renderer.KeyboardQueueSize", key_queue_.size()); + LOCAL_HISTOGRAM_COUNTS_100("Renderer.KeyboardQueueSize", key_queue_.size()); gesture_event_queue_.FlingHasBeenHalted(); diff --git a/content/child/child_histogram_message_filter.cc b/content/child/child_histogram_message_filter.cc index 3cf36ce..3e895fc 100644 --- a/content/child/child_histogram_message_filter.cc +++ b/content/child/child_histogram_message_filter.cc @@ -63,9 +63,11 @@ void ChildHistogramMessageFilter::UploadAllHistograms(int sequence_number) { sender_->Send( new ChildProcessHostMsg_ChildHistogramData(sequence_number, deltas)); +#ifndef NDEBUG static int count = 0; count++; - DHISTOGRAM_COUNTS("Histogram.ChildProcessHistogramSentCount", count); + LOCAL_HISTOGRAM_COUNTS("Histogram.ChildProcessHistogramSentCount", count); +#endif } } // namespace content diff --git a/content/child/web_database_observer_impl.cc b/content/child/web_database_observer_impl.cc index 62eee5f..686b51f5 100644 --- a/content/child/web_database_observer_impl.cc +++ b/content/child/web_database_observer_impl.cc @@ -38,8 +38,8 @@ int DetermineHistogramResult(int websql_error, int sqlite_error) { return std::min(websql_error + 30, kResultHistogramSize - 1); } -#define HISTOGRAM_WEBSQL_RESULT(name, is_sync_database, \ - callsite, websql_error, sqlite_error) \ +#define UMA_HISTOGRAM_WEBSQL_RESULT(name, is_sync_database, \ + callsite, websql_error, sqlite_error) \ do { \ DCHECK(callsite < kCallsiteHistogramSize); \ int result = DetermineHistogramResult(websql_error, sqlite_error); \ @@ -104,8 +104,8 @@ void WebDatabaseObserverImpl::reportOpenDatabaseResult( const WebString& database_name, bool is_sync_database, int callsite, int websql_error, int sqlite_error) { - HISTOGRAM_WEBSQL_RESULT("OpenResult", is_sync_database, - callsite, websql_error, sqlite_error); + UMA_HISTOGRAM_WEBSQL_RESULT("OpenResult", is_sync_database, callsite, + websql_error, sqlite_error); HandleSqliteError(origin_identifier, database_name, sqlite_error); } @@ -114,8 +114,8 @@ void WebDatabaseObserverImpl::reportChangeVersionResult( const WebString& database_name, bool is_sync_database, int callsite, int websql_error, int sqlite_error) { - HISTOGRAM_WEBSQL_RESULT("ChangeVersionResult", is_sync_database, - callsite, websql_error, sqlite_error); + UMA_HISTOGRAM_WEBSQL_RESULT("ChangeVersionResult", is_sync_database, callsite, + websql_error, sqlite_error); HandleSqliteError(origin_identifier, database_name, sqlite_error); } @@ -124,8 +124,8 @@ void WebDatabaseObserverImpl::reportStartTransactionResult( const WebString& database_name, bool is_sync_database, int callsite, int websql_error, int sqlite_error) { - HISTOGRAM_WEBSQL_RESULT("BeginResult", is_sync_database, - callsite, websql_error, sqlite_error); + UMA_HISTOGRAM_WEBSQL_RESULT("BeginResult", is_sync_database, callsite, + websql_error, sqlite_error); HandleSqliteError(origin_identifier, database_name, sqlite_error); } @@ -134,8 +134,8 @@ void WebDatabaseObserverImpl::reportCommitTransactionResult( const WebString& database_name, bool is_sync_database, int callsite, int websql_error, int sqlite_error) { - HISTOGRAM_WEBSQL_RESULT("CommitResult", is_sync_database, - callsite, websql_error, sqlite_error); + UMA_HISTOGRAM_WEBSQL_RESULT("CommitResult", is_sync_database, callsite, + websql_error, sqlite_error); HandleSqliteError(origin_identifier, database_name, sqlite_error); } @@ -144,8 +144,8 @@ void WebDatabaseObserverImpl::reportExecuteStatementResult( const WebString& database_name, bool is_sync_database, int callsite, int websql_error, int sqlite_error) { - HISTOGRAM_WEBSQL_RESULT("StatementResult", is_sync_database, - callsite, websql_error, sqlite_error); + UMA_HISTOGRAM_WEBSQL_RESULT("StatementResult", is_sync_database, callsite, + websql_error, sqlite_error); HandleSqliteError(origin_identifier, database_name, sqlite_error); } diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index 40140d5..c1f8e95 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc @@ -329,7 +329,7 @@ class MemoryObserver : public base::MessageLoop::TaskObserver { } virtual void DidProcessTask(const base::PendingTask& pending_task) OVERRIDE { - HISTOGRAM_MEMORY_KB("Memory.RendererUsed", GetMemoryUsageKB()); + LOCAL_HISTOGRAM_MEMORY_KB("Memory.RendererUsed", GetMemoryUsageKB()); } private: diff --git a/crypto/nss_util.cc b/crypto/nss_util.cc index 062bcb5..f0c726d 100644 --- a/crypto/nss_util.cc +++ b/crypto/nss_util.cc @@ -750,12 +750,12 @@ class NSSInitSingleton { 0, NSS_USE_ALG_IN_CERT_SIGNATURE); // The UMA bit is conditionally set for this histogram in - // chrome/common/startup_metric_utils.cc . - HISTOGRAM_CUSTOM_TIMES("Startup.SlowStartupNSSInit", - base::TimeTicks::Now() - start_time, - base::TimeDelta::FromMilliseconds(10), - base::TimeDelta::FromHours(1), - 50); + // components/startup_metric_utils.cc . + LOCAL_HISTOGRAM_CUSTOM_TIMES("Startup.SlowStartupNSSInit", + base::TimeTicks::Now() - start_time, + base::TimeDelta::FromMilliseconds(10), + base::TimeDelta::FromHours(1), + 50); } // NOTE(willchan): We don't actually execute this code since we leak NSS to diff --git a/net/cert/x509_certificate.cc b/net/cert/x509_certificate.cc index 0e410ad..880d487 100644 --- a/net/cert/x509_certificate.cc +++ b/net/cert/x509_certificate.cc @@ -158,7 +158,9 @@ void X509CertificateCache::InsertOrUpdate( // be guarded by the lock. if (old_handle) { X509Certificate::FreeOSCertHandle(old_handle); - DHISTOGRAM_COUNTS("X509CertificateReuseCount", 1); +#ifndef NDEBUG + LOCAL_HISTOGRAM_BOOLEAN("X509CertificateReuseCount", true); +#endif } } diff --git a/net/disk_cache/blockfile/block_bitmaps_v3.cc b/net/disk_cache/blockfile/block_bitmaps_v3.cc index 984ce49..011793c 100644 --- a/net/disk_cache/blockfile/block_bitmaps_v3.cc +++ b/net/disk_cache/blockfile/block_bitmaps_v3.cc @@ -148,7 +148,8 @@ int BlockBitmaps::HeaderNumberForNewBlock(FileType block_type, header_num = -1; } - HISTOGRAM_TIMES("DiskCache.GetFileForNewBlock", TimeTicks::Now() - start); + LOCAL_HISTOGRAM_TIMES("DiskCache.GetFileForNewBlock", + TimeTicks::Now() - start); return header_num; } diff --git a/net/disk_cache/blockfile/block_files.cc b/net/disk_cache/blockfile/block_files.cc index ae2e1b3..4ae217b 100644 --- a/net/disk_cache/blockfile/block_files.cc +++ b/net/disk_cache/blockfile/block_files.cc @@ -101,7 +101,7 @@ bool BlockHeader::CreateMapBlock(int size, int* index) { if (target != size) { header_->empty[target - size - 1]++; } - HISTOGRAM_TIMES("DiskCache.CreateBlock", TimeTicks::Now() - start); + LOCAL_HISTOGRAM_TIMES("DiskCache.CreateBlock", TimeTicks::Now() - start); return true; } } @@ -148,7 +148,7 @@ void BlockHeader::DeleteMapBlock(int index, int size) { base::subtle::MemoryBarrier(); header_->num_entries--; STRESS_DCHECK(header_->num_entries >= 0); - HISTOGRAM_TIMES("DiskCache.DeleteBlock", TimeTicks::Now() - start); + LOCAL_HISTOGRAM_TIMES("DiskCache.DeleteBlock", TimeTicks::Now() - start); } // Note that this is a simplified version of DeleteMapBlock(). @@ -566,7 +566,8 @@ MappedFile* BlockFiles::FileForNewBlock(FileType block_type, int block_count) { return NULL; break; } - HISTOGRAM_TIMES("DiskCache.GetFileForNewBlock", TimeTicks::Now() - start); + LOCAL_HISTOGRAM_TIMES("DiskCache.GetFileForNewBlock", + TimeTicks::Now() - start); return file; } diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc index 136941d..201bba4 100644 --- a/net/dns/host_resolver_impl.cc +++ b/net/dns/host_resolver_impl.cc @@ -767,7 +767,7 @@ class HostResolverImpl::ProcTask const int error, const int os_error) const { DCHECK(origin_loop_->BelongsToCurrentThread()); - enum Category { // Used in HISTOGRAM_ENUMERATION. + enum Category { // Used in UMA_HISTOGRAM_ENUMERATION. RESOLVE_SUCCESS, RESOLVE_FAIL, RESOLVE_SPECULATIVE_SUCCESS, diff --git a/sync/util/data_type_histogram_unittest.cc b/sync/util/data_type_histogram_unittest.cc index 67b5e64..df65735 100644 --- a/sync/util/data_type_histogram_unittest.cc +++ b/sync/util/data_type_histogram_unittest.cc @@ -13,13 +13,13 @@ namespace { class DataTypeHistogramTest : public testing::Test { }; -// Create a histogram of type HISTOGRAM_COUNTS for each model type. Nothing -// should break. +// Create a histogram of type LOCAL_HISTOGRAM_COUNTS for each model type. +// Nothing should break. TEST(DataTypeHistogramTest, BasicCount) { for (int i = FIRST_REAL_MODEL_TYPE; i <= LAST_REAL_MODEL_TYPE; ++i) { ModelType type = ModelTypeFromInt(i); #define PER_DATA_TYPE_MACRO(type_str) \ - HISTOGRAM_COUNTS("Prefix" type_str "Suffix", 1); + LOCAL_HISTOGRAM_COUNTS("Prefix" type_str "Suffix", 1); SYNC_DATA_TYPE_HISTOGRAM(type); #undef PER_DATA_TYPE_MACRO } |