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

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

Issue 13119014: Telemetry: Don't silently compare histograms from different processes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/perf/perf_tools/histogram.py » ('j') | 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 <climits> 7 #include <climits>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/json/json_string_value_serializer.h" 10 #include "base/json/json_string_value_serializer.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/metrics/histogram.h" 12 #include "base/metrics/histogram.h"
13 #include "base/metrics/histogram_samples.h" 13 #include "base/metrics/histogram_samples.h"
14 #include "base/metrics/sparse_histogram.h" 14 #include "base/metrics/sparse_histogram.h"
15 #include "base/pickle.h" 15 #include "base/pickle.h"
16 #include "base/process_util.h"
16 #include "base/values.h" 17 #include "base/values.h"
17 18
18 namespace base { 19 namespace base {
19 20
20 std::string HistogramTypeToString(HistogramType type) { 21 std::string HistogramTypeToString(HistogramType type) {
21 switch(type) { 22 switch(type) {
22 case HISTOGRAM: 23 case HISTOGRAM:
23 return "HISTOGRAM"; 24 return "HISTOGRAM";
24 case LINEAR_HISTOGRAM: 25 case LINEAR_HISTOGRAM:
25 return "LINEAR_HISTOGRAM"; 26 return "LINEAR_HISTOGRAM";
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 scoped_ptr<DictionaryValue> parameters(new DictionaryValue()); 113 scoped_ptr<DictionaryValue> parameters(new DictionaryValue());
113 GetParameters(parameters.get()); 114 GetParameters(parameters.get());
114 115
115 JSONStringValueSerializer serializer(output); 116 JSONStringValueSerializer serializer(output);
116 DictionaryValue root; 117 DictionaryValue root;
117 root.SetString("name", histogram_name()); 118 root.SetString("name", histogram_name());
118 root.SetInteger("count", count); 119 root.SetInteger("count", count);
119 root.SetInteger("flags", flags()); 120 root.SetInteger("flags", flags());
120 root.Set("params", parameters.release()); 121 root.Set("params", parameters.release());
121 root.Set("buckets", buckets.release()); 122 root.Set("buckets", buckets.release());
123 root.SetInteger("pid", GetCurrentProcId());
122 serializer.Serialize(root); 124 serializer.Serialize(root);
123 } 125 }
124 126
125 } // namespace base 127 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | tools/perf/perf_tools/histogram.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698