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

Unified Diff: webrtc/system_wrappers/source/metrics_default.cc

Issue 2548463002: Add linearly spaced counting histograms (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/system_wrappers/include/metrics.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/system_wrappers/source/metrics_default.cc
diff --git a/webrtc/system_wrappers/source/metrics_default.cc b/webrtc/system_wrappers/source/metrics_default.cc
index d7d24fa50dab0e9e33aa8f8aadd3ac32b0f63bd3..6ca90dafdc84933c8805f0f550809c1ceb36fe66 100644
--- a/webrtc/system_wrappers/source/metrics_default.cc
+++ b/webrtc/system_wrappers/source/metrics_default.cc
@@ -213,6 +213,19 @@ Histogram* HistogramFactoryGetCounts(const std::string& name,
int min,
int max,
int bucket_count) {
+ // TODO(asapersson): Alternative implementation will be needed if this
+ // histogram type should be truly exponential.
+ return HistogramFactoryGetCountsLinear(name, min, max, bucket_count);
+}
+
+// Histogram with linearly spaced buckets.
+// Creates (or finds) histogram.
+// The returned histogram pointer is cached (and used for adding samples in
+// subsequent calls).
+Histogram* HistogramFactoryGetCountsLinear(const std::string& name,
+ int min,
+ int max,
+ int bucket_count) {
RtcHistogramMap* map = GetMap();
if (!map)
return nullptr;
« no previous file with comments | « webrtc/system_wrappers/include/metrics.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698