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

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 persistence around PersistentGet methods to fix visibility problems Created 4 years, 11 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
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 <utility> 9 #include <utility>
10 10
11 #include "base/json/json_string_value_serializer.h" 11 #include "base/json/json_string_value_serializer.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/metrics/histogram.h" 14 #include "base/metrics/histogram.h"
15 #include "base/metrics/histogram_persistence.h"
15 #include "base/metrics/histogram_samples.h" 16 #include "base/metrics/histogram_samples.h"
16 #include "base/metrics/sparse_histogram.h" 17 #include "base/metrics/sparse_histogram.h"
17 #include "base/metrics/statistics_recorder.h" 18 #include "base/metrics/statistics_recorder.h"
18 #include "base/pickle.h" 19 #include "base/pickle.h"
19 #include "base/process/process_handle.h" 20 #include "base/process/process_handle.h"
20 #include "base/strings/stringprintf.h" 21 #include "base/strings/stringprintf.h"
22 #include "base/synchronization/lock.h"
Alexei Svitkine (slow) 2016/01/12 21:54:44 Doesn't seem like this header or the one on line 1
bcwhite 2016/01/13 13:38:29 Done.
21 #include "base/values.h" 23 #include "base/values.h"
22 24
23 namespace base { 25 namespace base {
24 26
25 std::string HistogramTypeToString(HistogramType type) { 27 std::string HistogramTypeToString(HistogramType type) {
26 switch (type) { 28 switch (type) {
27 case HISTOGRAM: 29 case HISTOGRAM:
28 return "HISTOGRAM"; 30 return "HISTOGRAM";
29 case LINEAR_HISTOGRAM: 31 case LINEAR_HISTOGRAM:
30 return "LINEAR_HISTOGRAM"; 32 return "LINEAR_HISTOGRAM";
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 return result; 159 return result;
158 } 160 }
159 161
160 void HistogramBase::WriteAsciiBucketValue(Count current, 162 void HistogramBase::WriteAsciiBucketValue(Count current,
161 double scaled_sum, 163 double scaled_sum,
162 std::string* output) const { 164 std::string* output) const {
163 StringAppendF(output, " (%d = %3.1f%%)", current, current/scaled_sum); 165 StringAppendF(output, " (%d = %3.1f%%)", current, current/scaled_sum);
164 } 166 }
165 167
166 } // namespace base 168 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698