Commit 2274746a authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

heap: Fix BlinkGC.MainThreadMarkingThroughput

The metric is supposed to compute time spent per marked bytes and not
allocated heap size which includes garbage as well.

Bug: 986235
Change-Id: Ifdc1eedb276f8ce6a324774e233c132fefa1c747
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2087726
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: default avatarOmer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747207}
parent 2eca0bcb
......@@ -954,14 +954,13 @@ void UpdateHistograms(const ThreadHeapStatsCollector::Event& event) {
event.scope_data[ThreadHeapStatsCollector::kMarkWeakProcessing]);
base::TimeDelta marking_duration = event.foreground_marking_time();
constexpr size_t kMinObjectSizeForReportingThroughput = 1024 * 1024;
constexpr size_t kMinMarkedBytesForReportingThroughput = 1024 * 1024;
if (base::TimeTicks::IsHighResolution() &&
(event.object_size_in_bytes_before_sweeping >
kMinObjectSizeForReportingThroughput) &&
(event.marked_bytes > kMinMarkedBytesForReportingThroughput) &&
!marking_duration.is_zero()) {
DCHECK_GT(marking_duration.InMillisecondsF(), 0.0);
const int main_thread_marking_throughput_mb_per_s = static_cast<int>(
static_cast<double>(event.object_size_in_bytes_before_sweeping) /
static_cast<double>(event.marked_bytes) /
marking_duration.InMillisecondsF() * 1000 / 1024 / 1024);
UMA_HISTOGRAM_COUNTS_100000("BlinkGC.MainThreadMarkingThroughput",
main_thread_marking_throughput_mb_per_s);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment