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

Side by Side Diff: base/metrics/histogram_base.cc

Issue 2516433005: Fix histogram pid value (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | 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 (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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698