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

Unified Diff: src/counters.cc

Issue 2795763002: Collect array buffer allocation sizes for UMA in megabytes. (Closed)
Patch Set: Fix that allocation size can be zero. Created 3 years, 9 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
« src/counters.h ('K') | « src/counters.h ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/counters.cc
diff --git a/src/counters.cc b/src/counters.cc
index 996aa333d411fe08526f1f80bc00a351dabae21d..87ab983bd94f12d4ab9de32a27c84382623cada4 100644
--- a/src/counters.cc
+++ b/src/counters.cc
@@ -81,6 +81,24 @@ Counters::Counters(Isolate* isolate) {
}
static const struct {
+ MegabyteHistogram Counters::*member;
+ const char* caption;
+ int min;
+ int max;
+ int num_buckets;
+ } kMegabyteHistograms[] = {
+#define HR(name, caption, min, max, num_buckets) \
+ {&Counters::name##_, #caption, min, max, num_buckets},
+ MEGABYTE_HISTOGRAM_RANGE_LIST(HR)
+#undef HR
+ };
+ for (const auto& histogram : kMegabyteHistograms) {
+ this->*histogram.member =
+ MegabyteHistogram(histogram.caption, histogram.min, histogram.max,
+ histogram.num_buckets, isolate);
+ }
+
+ static const struct {
HistogramTimer Counters::*member;
const char* caption;
int max;
@@ -238,6 +256,10 @@ void Counters::ResetHistograms() {
HISTOGRAM_RANGE_LIST(HR)
#undef HR
+#define HR(name, caption, min, max, num_buckets) name##_.Reset();
+ MEGABYTE_HISTOGRAM_RANGE_LIST(HR)
+#undef HR
+
#define HT(name, caption, max, res) name##_.Reset();
HISTOGRAM_TIMER_LIST(HT)
#undef HT
« src/counters.h ('K') | « src/counters.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698