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

Side by Side Diff: components/metrics/histogram_encoder.cc

Issue 1471073007: Reorganize histograms for persistence. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shmem-alloc
Patch Set: added GN changes 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/metrics/histogram_encoder.h" 5 #include "components/metrics/histogram_encoder.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
12 #include "base/metrics/histogram_samples.h" 12 #include "base/metrics/histogram_samples.h"
13 #include "components/metrics/metrics_hashes.h" 13 #include "base/metrics/metrics_hashes.h"
14 14
15 using base::SampleCountIterator; 15 using base::SampleCountIterator;
16 16
17 namespace metrics { 17 namespace metrics {
18 18
19 void EncodeHistogramDelta(const std::string& histogram_name, 19 void EncodeHistogramDelta(const std::string& histogram_name,
20 const base::HistogramSamples& snapshot, 20 const base::HistogramSamples& snapshot,
21 ChromeUserMetricsExtension* uma_proto) { 21 ChromeUserMetricsExtension* uma_proto) {
22 DCHECK_NE(0, snapshot.TotalCount()); 22 DCHECK_NE(0, snapshot.TotalCount());
23 DCHECK(uma_proto); 23 DCHECK(uma_proto);
(...skipping 22 matching lines...) Expand all
46 if (i + 1 < histogram_proto->bucket_size() && 46 if (i + 1 < histogram_proto->bucket_size() &&
47 bucket->max() == histogram_proto->bucket(i + 1).min()) { 47 bucket->max() == histogram_proto->bucket(i + 1).min()) {
48 bucket->clear_max(); 48 bucket->clear_max();
49 } else if (bucket->max() == bucket->min() + 1) { 49 } else if (bucket->max() == bucket->min() + 1) {
50 bucket->clear_min(); 50 bucket->clear_min();
51 } 51 }
52 } 52 }
53 } 53 }
54 54
55 } // namespace metrics 55 } // namespace metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698