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

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

Issue 1425533011: Support "shared" histograms between processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shmem-alloc
Patch Set: reorganized Factory class to be cleaner Created 5 years 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
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 #include <utility> 8 #include <utility>
9 9
10 #include "base/json/json_string_value_serializer.h" 10 #include "base/json/json_string_value_serializer.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/metrics/histogram.h" 13 #include "base/metrics/histogram.h"
14 #include "base/metrics/histogram_persistence.h"
14 #include "base/metrics/histogram_samples.h" 15 #include "base/metrics/histogram_samples.h"
15 #include "base/metrics/sparse_histogram.h" 16 #include "base/metrics/sparse_histogram.h"
16 #include "base/metrics/statistics_recorder.h" 17 #include "base/metrics/statistics_recorder.h"
17 #include "base/pickle.h" 18 #include "base/pickle.h"
18 #include "base/process/process_handle.h" 19 #include "base/process/process_handle.h"
19 #include "base/strings/stringprintf.h" 20 #include "base/strings/stringprintf.h"
21 #include "base/synchronization/lock.h"
20 #include "base/values.h" 22 #include "base/values.h"
21 23
22 namespace base { 24 namespace base {
23 25
24 std::string HistogramTypeToString(HistogramType type) { 26 std::string HistogramTypeToString(HistogramType type) {
25 switch (type) { 27 switch (type) {
26 case HISTOGRAM: 28 case HISTOGRAM:
27 return "HISTOGRAM"; 29 return "HISTOGRAM";
28 case LINEAR_HISTOGRAM: 30 case LINEAR_HISTOGRAM:
29 return "LINEAR_HISTOGRAM"; 31 return "LINEAR_HISTOGRAM";
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 return result; 158 return result;
157 } 159 }
158 160
159 void HistogramBase::WriteAsciiBucketValue(Count current, 161 void HistogramBase::WriteAsciiBucketValue(Count current,
160 double scaled_sum, 162 double scaled_sum,
161 std::string* output) const { 163 std::string* output) const {
162 StringAppendF(output, " (%d = %3.1f%%)", current, current/scaled_sum); 164 StringAppendF(output, " (%d = %3.1f%%)", current, current/scaled_sum);
163 } 165 }
164 166
165 } // namespace base 167 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698