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

Side by Side Diff: components/metrics/metrics_service.cc

Issue 1780993002: Break global impact of PersistentHistogramAllocator into a separate class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor-hp
Patch Set: fixed bad formatting from upstream scoped_ptr change Created 4 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 | « components/metrics/file_metrics_provider_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 //------------------------------------------------------------------------------ 5 //------------------------------------------------------------------------------
6 // Description of the life cycle of a instance of MetricsService. 6 // Description of the life cycle of a instance of MetricsService.
7 // 7 //
8 // OVERVIEW 8 // OVERVIEW
9 // 9 //
10 // A MetricsService instance is typically created at application startup. It is 10 // A MetricsService instance is typically created at application startup. It is
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 if (log_manager_.current_log()->num_events() > kEventLimit) { 740 if (log_manager_.current_log()->num_events() > kEventLimit) {
741 UMA_HISTOGRAM_COUNTS("UMA.Discarded Log Events", 741 UMA_HISTOGRAM_COUNTS("UMA.Discarded Log Events",
742 log_manager_.current_log()->num_events()); 742 log_manager_.current_log()->num_events());
743 log_manager_.DiscardCurrentLog(); 743 log_manager_.DiscardCurrentLog();
744 OpenNewLog(); // Start trivial log to hold our histograms. 744 OpenNewLog(); // Start trivial log to hold our histograms.
745 } 745 }
746 746
747 // If a persistent allocator is in use, update its internal histograms (such 747 // If a persistent allocator is in use, update its internal histograms (such
748 // as how much memory is being used) before reporting. 748 // as how much memory is being used) before reporting.
749 base::PersistentHistogramAllocator* allocator = 749 base::PersistentHistogramAllocator* allocator =
750 base::PersistentHistogramAllocator::GetGlobalAllocator(); 750 base::GlobalHistogramAllocator::Get();
751 if (allocator) 751 if (allocator)
752 allocator->UpdateTrackingHistograms(); 752 allocator->UpdateTrackingHistograms();
753 753
754 // Put incremental data (histogram deltas, and realtime stats deltas) at the 754 // Put incremental data (histogram deltas, and realtime stats deltas) at the
755 // end of all log transmissions (initial log handles this separately). 755 // end of all log transmissions (initial log handles this separately).
756 // RecordIncrementalStabilityElements only exists on the derived 756 // RecordIncrementalStabilityElements only exists on the derived
757 // MetricsLog class. 757 // MetricsLog class.
758 MetricsLog* current_log = log_manager_.current_log(); 758 MetricsLog* current_log = log_manager_.current_log();
759 DCHECK(current_log); 759 DCHECK(current_log);
760 RecordCurrentEnvironment(current_log); 760 RecordCurrentEnvironment(current_log);
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
1161 base::Time::Now().ToTimeT()); 1161 base::Time::Now().ToTimeT());
1162 } 1162 }
1163 1163
1164 void MetricsService::SkipAndDiscardUpload() { 1164 void MetricsService::SkipAndDiscardUpload() {
1165 log_manager_.DiscardStagedLog(); 1165 log_manager_.DiscardStagedLog();
1166 scheduler_->UploadCancelled(); 1166 scheduler_->UploadCancelled();
1167 log_upload_in_progress_ = false; 1167 log_upload_in_progress_ = false;
1168 } 1168 }
1169 1169
1170 } // namespace metrics 1170 } // namespace metrics
OLDNEW
« no previous file with comments | « components/metrics/file_metrics_provider_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698