| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "base/metrics/histogram_base.h" | 5 #include "base/metrics/histogram_base.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 root.SetInteger("pid", GetCurrentProcId()); | 121 root.SetInteger("pid", GetCurrentProcId()); |
| 122 serializer.Serialize(root); | 122 serializer.Serialize(root); |
| 123 } | 123 } |
| 124 | 124 |
| 125 // static | 125 // static |
| 126 void HistogramBase::EnableActivityReportHistogram( | 126 void HistogramBase::EnableActivityReportHistogram( |
| 127 const std::string& process_type) { | 127 const std::string& process_type) { |
| 128 DCHECK(!report_histogram_); | 128 DCHECK(!report_histogram_); |
| 129 size_t existing = StatisticsRecorder::GetHistogramCount(); | 129 size_t existing = StatisticsRecorder::GetHistogramCount(); |
| 130 if (existing != 0) { | 130 if (existing != 0) { |
| 131 DLOG(WARNING) << existing | 131 DVLOG(1) << existing |
| 132 << " histograms were created before reporting was enabled."; | 132 << " histograms were created before reporting was enabled."; |
| 133 } | 133 } |
| 134 | 134 |
| 135 std::string name = | 135 std::string name = |
| 136 "UMA.Histograms.Activity" + | 136 "UMA.Histograms.Activity" + |
| 137 (process_type.empty() ? process_type : "." + process_type); | 137 (process_type.empty() ? process_type : "." + process_type); |
| 138 | 138 |
| 139 // Calling FactoryGet() here rather than using a histogram-macro works | 139 // Calling FactoryGet() here rather than using a histogram-macro works |
| 140 // around some problems with tests that could end up seeing the results | 140 // around some problems with tests that could end up seeing the results |
| 141 // histogram when not expected due to a bad interaction between | 141 // histogram when not expected due to a bad interaction between |
| 142 // HistogramTester and StatisticsRecorder. | 142 // HistogramTester and StatisticsRecorder. |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 report_histogram_->Add(HISTOGRAM_REPORT_FLAG_UMA_TARGETED); | 224 report_histogram_->Add(HISTOGRAM_REPORT_FLAG_UMA_TARGETED); |
| 225 break; | 225 break; |
| 226 | 226 |
| 227 case HISTOGRAM_LOOKUP: | 227 case HISTOGRAM_LOOKUP: |
| 228 report_histogram_->Add(HISTOGRAM_REPORT_HISTOGRAM_LOOKUP); | 228 report_histogram_->Add(HISTOGRAM_REPORT_HISTOGRAM_LOOKUP); |
| 229 break; | 229 break; |
| 230 } | 230 } |
| 231 } | 231 } |
| 232 | 232 |
| 233 } // namespace base | 233 } // namespace base |
| OLD | NEW |