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

Unified Diff: base/metrics/chromeos_metrics.h

Issue 227873002: Create a histogram serialization mechanism in components/metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/chromeos_metrics.h
diff --git a/base/metrics/chromeos_metrics.h b/base/metrics/chromeos_metrics.h
new file mode 100644
index 0000000000000000000000000000000000000000..cad68dab5f394cb9dd048c6a48f72b77e77e3070
--- /dev/null
+++ b/base/metrics/chromeos_metrics.h
@@ -0,0 +1,35 @@
+// 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_CHROMEOS_METRICS_H_
+# define BASE_METRICS_CHROMEOS_METRICS_H_
+
+#include <fcntl.h>
achaulk 2014/04/07 22:16:00 Typically the style is to forward declare as much
+#include <list>
+
+#include "base/base_export.h"
+#include "base/files/file_path.h"
+#include "base/memory/scoped_vector.h"
+#include "base/metrics/crash_sample.h"
+#include "base/metrics/metric_sample.h"
+
+namespace base {
+class BASE_EXPORT ChromeOSMetrics {
+ public:
+ // static
+ static MetricSample* ReadMessage(int fd);
achaulk 2014/04/07 22:16:00 Since everything is static, why not just have this
+ static MetricSample* ReadSample(int32_t message_size, uint8* buffer);
+ static void ReadMetricsFromFile(const std::string& filename,
+ ScopedVector<MetricSample>* metrics);
+ static int32_t FormatSample(int32_t buffer_size, char* buffer,
+ const char* format, ...);
+ static int32_t WriteChromeMessage(MetricSample* sample, int32_t buffer_size,
+ char* buffer);
+ static bool WriteMetricToFile(MetricSample* sample,
+ const std::string& filename);
+ private:
+ static const int kMessageMaxLength = 1024;
+};
+} // namespace base
+# endif // BASE_METRICS_CHROMEOS_METRICS_H_

Powered by Google App Engine
This is Rietveld 408576698