• kschimpf's avatar
    Collect array buffer allocation sizes for UMA in megabytes. · 510abe73
    kschimpf authored
    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}
    510abe73
Name
Last commit
Last update
benchmarks Loading commit data...
build_overrides Loading commit data...
docs Loading commit data...
gni Loading commit data...
gypfiles Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
Makefile Loading commit data...
Makefile.android Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...