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

Unified Diff: base/metrics/metric_sample.h

Issue 227873002: Create a histogram serialization mechanism in components/metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactoring to use string instead of char buffers Created 6 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 side-by-side diff with in-line comments
Download patch
Index: base/metrics/metric_sample.h
diff --git a/base/metrics/metric_sample.h b/base/metrics/metric_sample.h
new file mode 100644
index 0000000000000000000000000000000000000000..0256df9afcf5334717f013a3bb70da37c424e4a3
--- /dev/null
+++ b/base/metrics/metric_sample.h
@@ -0,0 +1,36 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_METRICS_METRIC_SAMPLE_H_
+#define BASE_METRICS_METRIC_SAMPLE_H_
+
+#include <string>
+
+#include "base/base_export.h"
+
+using std::string;
+
+namespace base {
+class BASE_EXPORT MetricSample {
gauravsh 2014/04/11 23:50:51 I would think about adding comments for these clas
+ public:
+ enum SampleType {
+ CRASH,
+ HISTOGRAM,
+ LINEAR_HISTOGRAM,
+ SPARSE_HISTOGRAM,
+ USER_ACTION
+ };
+ explicit MetricSample(SampleType t);
+ virtual ~MetricSample();
+ virtual bool isValid() const;
gauravsh 2014/04/11 23:50:51 NIT: newline before this.
gauravsh 2014/04/11 23:50:51 function names (except accessors) start uppsercase
+ SampleType type();
gauravsh 2014/04/11 23:50:51 This can be a const function.
+ string name() const;
+ virtual string toString() const;
+
+ protected:
+ SampleType type_;
+ string name_;
+};
+} // namespace base
+#endif // BASE_METRICS_METRIC_SAMPLE_H_

Powered by Google App Engine
This is Rietveld 408576698