• Omer Katz's avatar
    cppgc: Add UMA support · adda4c5f
    Omer Katz authored
    This CL introduces cppgc::HistogramRecorder api which is similar to the
    v8::metrics::Recorder api and is used by cppgc to report histogram
    samples to embedders. Embedders should implement the api if they want to
    collect histograms and provide an instance of it on heap creation.
    
    CppHeap uses an adaptor class that implements the HistogramRecorder api
    and is used to forward the relevant info to the relevant
    v8::metrics::Recorder.
    
    The api used 3 data structures: 2 for incremental steps that need to be
    reported as they come (marking and sweeping) and 1 for the end of a GC
    cycle that aggregates statistics over the entire cycle.
    The data structure only provide the "raw" samples (e.g. atomic mark
    time, incremental mark time, etc...). The embedder is expected to
    compute aggregate histogram on its own (e.g. overall marking time).
    
    Bug: chromium:1056170
    Change-Id: If63ef50a29a21594f654edb83084598980d221ce
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2642258
    Commit-Queue: Omer Katz <omerkatz@chromium.org>
    Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
    Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#72256}
    adda4c5f
stats-collector-unittest.cc 7.69 KB