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

Unified Diff: base/metrics/single_value_histograms.h

Issue 2687583002: Add support for single sample metrics. (Closed)
Patch Set: Redesign! Created 3 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/single_value_histograms.h
diff --git a/base/metrics/single_value_histograms.h b/base/metrics/single_value_histograms.h
new file mode 100644
index 0000000000000000000000000000000000000000..c6e98ae358258186e1178550b80b4e6a38c21020
--- /dev/null
+++ b/base/metrics/single_value_histograms.h
@@ -0,0 +1,37 @@
+// Copyright 2017 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_SINGLE_VALUE_HISTOGRAMS_H_
+#define BASE_METRICS_SINGLE_VALUE_HISTOGRAMS_H_
+
+#include "base/base_export.h"
+#include "base/macros.h"
+#include "base/metrics/histogram_base.h"
+
+namespace base {
+
+class BASE_EXPORT SingleValueCountsHistogram {
+ public:
+ virtual ~SingleValueCountsHistogram() {}
+
+ virtual void SetSample(base::HistogramBase::Sample sample) = 0;
+};
+
+class BASE_EXPORT SingleValueHistogramsFactory {
+ public:
+ virtual ~SingleValueHistogramsFactory() {}
+
+ static SingleValueHistogramsFactory* Get();
+ static void SetFactory(SingleValueHistogramsFactory* factory);
+
+ virtual std::unique_ptr<SingleValueCountsHistogram>
+ CreateSingleValueCountsHistogram(const std::string& name,
+ base::HistogramBase::Sample min,
+ base::HistogramBase::Sample max,
+ uint32_t bucket_count) = 0;
+};
+
+} // namespace base
+
+#endif // BASE_METRICS_SINGLE_VALUE_HISTOGRAMS_H_

Powered by Google App Engine
This is Rietveld 408576698