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

Side by Side Diff: components/metrics/serialization/metric_sample.h

Issue 644603002: Cleanup of component/metrics for GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: source_set Created 6 years, 2 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
« no previous file with comments | « components/metrics/BUILD.gn ('k') | components/metrics/serialization/metric_sample.cc » ('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 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 #ifndef COMPONENTS_METRICS_SERIALIZATION_METRIC_SAMPLE_H_ 5 #ifndef COMPONENTS_METRICS_SERIALIZATION_METRIC_SAMPLE_H_
6 #define COMPONENTS_METRICS_SERIALIZATION_METRIC_SAMPLE_H_ 6 #define COMPONENTS_METRICS_SERIALIZATION_METRIC_SAMPLE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
(...skipping 25 matching lines...) Expand all
36 36
37 // Getters for type and name. All types of metrics have these so we do not 37 // Getters for type and name. All types of metrics have these so we do not
38 // need to check the type. 38 // need to check the type.
39 SampleType type() const { return type_; } 39 SampleType type() const { return type_; }
40 const std::string& name() const { return name_; } 40 const std::string& name() const { return name_; }
41 41
42 // Getters for sample, min, max, bucket_count. 42 // Getters for sample, min, max, bucket_count.
43 // Check the metric type to make sure the request make sense. (ex: a crash 43 // Check the metric type to make sure the request make sense. (ex: a crash
44 // sample does not have a bucket_count so we crash if we call bucket_count() 44 // sample does not have a bucket_count so we crash if we call bucket_count()
45 // on it.) 45 // on it.)
46 const int sample() const; 46 int sample() const;
47 const int min() const; 47 int min() const;
48 const int max() const; 48 int max() const;
49 const int bucket_count() const; 49 int bucket_count() const;
50 50
51 // Returns a serialized version of the sample. 51 // Returns a serialized version of the sample.
52 // 52 //
53 // The serialized message for each type is: 53 // The serialized message for each type is:
54 // crash: crash\0|name_|\0 54 // crash: crash\0|name_|\0
55 // user action: useraction\0|name_|\0 55 // user action: useraction\0|name_|\0
56 // histogram: histogram\0|name_| |sample_| |min_| |max_| |bucket_count_|\0 56 // histogram: histogram\0|name_| |sample_| |min_| |max_| |bucket_count_|\0
57 // sparsehistogram: sparsehistogram\0|name_| |sample_|\0 57 // sparsehistogram: sparsehistogram\0|name_| |sample_|\0
58 // linearhistogram: linearhistogram\0|name_| |sample_| |max_|\0 58 // linearhistogram: linearhistogram\0|name_| |sample_| |max_|\0
59 std::string ToString() const; 59 std::string ToString() const;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 const int min_; 110 const int min_;
111 const int max_; 111 const int max_;
112 const int bucket_count_; 112 const int bucket_count_;
113 113
114 DISALLOW_COPY_AND_ASSIGN(MetricSample); 114 DISALLOW_COPY_AND_ASSIGN(MetricSample);
115 }; 115 };
116 116
117 } // namespace metrics 117 } // namespace metrics
118 118
119 #endif // COMPONENTS_METRICS_SERIALIZATION_METRIC_SAMPLE_H_ 119 #endif // COMPONENTS_METRICS_SERIALIZATION_METRIC_SAMPLE_H_
OLDNEW
« no previous file with comments | « components/metrics/BUILD.gn ('k') | components/metrics/serialization/metric_sample.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698