OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |