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

Issue 2795763002: Collect array buffer allocation sizes for UMA in megabytes. (Closed)

Created:
3 years, 8 months ago by kschimpf
Modified:
3 years, 8 months ago
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/heads/master
Project:
v8
Visibility:
Public.

Description

Collect array buffer allocation sizes for UMA in megabytes. After discussion with Chrome reviewers for UMA, it was decided that we would report array buffer allocation sizes in megabytes (not the log). They also wanted to wait until there is proof that small array buffer allocations would flood the histogram. Hence, all allocation sizes are sampled. There were several ways we could have added the notion of megabyte samples to V8 code. None of them are a great fit. This code simply provides a local function within the code that needs it. Other possible solutions but rejected were: a) Use a subclass of histogram to collect data at the megabyte level. It has it's own Add() method that converts the size from bytes to megabytes, and then call the generic add method AddSample(). This solution appears to follow the conventions of subclasses of class Histogram. b) Use Chrome macros - Rejected because it involves changing the counter representation of V8. c) Add a method AddMegabyteSample() to base class Histogram. Rejected because it may get confusing if a lot of different measures are added the the base class of histograms. d) Make method AddSample() virtual and override in the derived class. Rejected in that sampling is supposed to be fast, and adding a virtual call may be breaking that contract. d) Do not add a derived class. Rather just do the conversions at the call sites. Rejected because this duplicates code, and also makes it hard to change assumptions on how to calculate. For Chromes UMA changes see: CL: https://codereview.chromium.org/2795463002 BUG=chromium:704922 R=bbudge@chromium.org,bradnelson@chromium.org,mtrofin@chromium.org Review-Url: https://codereview.chromium.org/2795763002 Cr-Commit-Position: refs/heads/master@{#44388} Committed: https://chromium.googlesource.com/v8/v8/+/510abe732e132b8a876374b13d5f632086064a72

Patch Set 1 #

Total comments: 2

Patch Set 2 : Fix call to AddSample to cast argument to int. #

Patch Set 3 : Fix that allocation size can be zero. #

Total comments: 2

Patch Set 4 : Localize size conversion. #

Total comments: 2

Patch Set 5 : Fix name of convertToMG. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -10 lines) Patch
M src/counters.h View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M src/objects.cc View 1 2 3 4 3 chunks +10 lines, -8 lines 0 comments Download

Messages

Total messages: 28 (19 generated)
kschimpf
Please review. Thanks!
3 years, 8 months ago (2017-04-03 17:14:06 UTC) #2
Mircea Trofin
lgtm, 1 nit. https://codereview.chromium.org/2795763002/diff/1/src/counters.cc File src/counters.cc (right): https://codereview.chromium.org/2795763002/diff/1/src/counters.cc#newcode85 src/counters.cc:85: const char* caption; could we initialize ...
3 years, 8 months ago (2017-04-03 17:26:21 UTC) #8
kschimpf
https://codereview.chromium.org/2795763002/diff/1/src/counters.cc File src/counters.cc (right): https://codereview.chromium.org/2795763002/diff/1/src/counters.cc#newcode85 src/counters.cc:85: const char* caption; On 2017/04/03 17:26:20, Mircea Trofin wrote: ...
3 years, 8 months ago (2017-04-03 17:33:41 UTC) #11
bbudge
https://codereview.chromium.org/2795763002/diff/40001/src/counters.h File src/counters.h (right): https://codereview.chromium.org/2795763002/diff/40001/src/counters.h#newcode244 src/counters.h:244: }; This seems like a lot just to scale ...
3 years, 8 months ago (2017-04-03 18:02:41 UTC) #12
kschimpf
https://codereview.chromium.org/2795763002/diff/40001/src/counters.h File src/counters.h (right): https://codereview.chromium.org/2795763002/diff/40001/src/counters.h#newcode244 src/counters.h:244: }; On 2017/04/03 18:02:41, bbudge wrote: > This seems ...
3 years, 8 months ago (2017-04-03 19:20:55 UTC) #18
bbudge
LGTM w/nit https://codereview.chromium.org/2795763002/diff/60001/src/objects.cc File src/objects.cc (right): https://codereview.chromium.org/2795763002/diff/60001/src/objects.cc#newcode19468 src/objects.cc:19468: inline int convertToMb(size_t size) { nit: ConvertToMb ...
3 years, 8 months ago (2017-04-03 23:11:40 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2795763002/80001
3 years, 8 months ago (2017-04-04 16:59:54 UTC) #24
kschimpf
https://codereview.chromium.org/2795763002/diff/60001/src/objects.cc File src/objects.cc (right): https://codereview.chromium.org/2795763002/diff/60001/src/objects.cc#newcode19468 src/objects.cc:19468: inline int convertToMb(size_t size) { On 2017/04/03 23:11:40, bbudge ...
3 years, 8 months ago (2017-04-04 17:00:01 UTC) #25
commit-bot: I haz the power
3 years, 8 months ago (2017-04-04 17:26:16 UTC) #28
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/v8/v8/+/510abe732e132b8a876374b13d5f6320860...

Powered by Google App Engine
This is Rietveld 408576698