From 22666f8258238fe0997d469f51323bcb50807f69 Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Tue, 21 Mar 2023 18:57:09 +0000 Subject: [PATCH] Bug 1818391 - Clamp parallel marking utilization telemetry value r=sfink I don't know how this is generating a value that is outside these limits, but we can sometimes get inconsistent timestamps so maybe that is happening. The simplest thing to do is clamp the value to sensible limits. Differential Revision: https://phabricator.services.mozilla.com/D173173 --- js/src/gc/Statistics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/gc/Statistics.cpp b/js/src/gc/Statistics.cpp index 7736570a0165..db1ef9bd32b9 100644 --- a/js/src/gc/Statistics.cpp +++ b/js/src/gc/Statistics.cpp @@ -1118,7 +1118,7 @@ void Statistics::sendGCTelemetry() { double utilization = parallelRunTime / (wallTime * threadCount); runtime->metrics().GC_PARALLEL_MARK_SPEEDUP(uint32_t(speedup * 100.0)); runtime->metrics().GC_PARALLEL_MARK_UTILIZATION( - uint32_t(utilization * 100.0)); + std::clamp(utilization * 100.0, 0, 100)); runtime->metrics().GC_PARALLEL_MARK_INTERRUPTIONS( getCount(COUNT_PARALLEL_MARK_INTERRUPTIONS)); } -- 2.11.4.GIT