| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 GetParameters(parameters.get()); | 111 GetParameters(parameters.get()); |
| 112 | 112 |
| 113 JSONStringValueSerializer serializer(output); | 113 JSONStringValueSerializer serializer(output); |
| 114 DictionaryValue root; | 114 DictionaryValue root; |
| 115 root.SetString("name", histogram_name()); | 115 root.SetString("name", histogram_name()); |
| 116 root.SetInteger("count", count); | 116 root.SetInteger("count", count); |
| 117 root.SetDouble("sum", static_cast<double>(sum)); | 117 root.SetDouble("sum", static_cast<double>(sum)); |
| 118 root.SetInteger("flags", flags()); | 118 root.SetInteger("flags", flags()); |
| 119 root.Set("params", std::move(parameters)); | 119 root.Set("params", std::move(parameters)); |
| 120 root.Set("buckets", std::move(buckets)); | 120 root.Set("buckets", std::move(buckets)); |
| 121 root.SetInteger("pid", GetCurrentProcId()); | 121 root.SetInteger("pid", GetUniqueIdForProcess()); |
| 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 DVLOG(1) << existing | 131 DVLOG(1) << existing |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 report_histogram_->Add(HISTOGRAM_REPORT_FLAG_UMA_TARGETED); | 219 report_histogram_->Add(HISTOGRAM_REPORT_FLAG_UMA_TARGETED); |
| 220 break; | 220 break; |
| 221 | 221 |
| 222 case HISTOGRAM_LOOKUP: | 222 case HISTOGRAM_LOOKUP: |
| 223 report_histogram_->Add(HISTOGRAM_REPORT_HISTOGRAM_LOOKUP); | 223 report_histogram_->Add(HISTOGRAM_REPORT_HISTOGRAM_LOOKUP); |
| 224 break; | 224 break; |
| 225 } | 225 } |
| 226 } | 226 } |
| 227 | 227 |
| 228 } // namespace base | 228 } // namespace base |
| OLD | NEW |