From e04febfc1966ca095ac724d973ac62c40d637391 Mon Sep 17 00:00:00 2001 From: Sean Feng Date: Fri, 23 Oct 2020 19:47:20 +0000 Subject: [PATCH] Bug 1518999 - Use the same conversion for Chrome and Firefox for FCP r=sparky,perftest-reviewers Since this bug, Firefox will start to use the same conversion as Chrome for reporting FCP. This patch cleans our code a little bit to adapt that. Differential Revision: https://phabricator.services.mozilla.com/D90109 --- testing/raptor/raptor/results.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/testing/raptor/raptor/results.py b/testing/raptor/raptor/results.py index 7b7925202a25..72aa153b6b1a 100644 --- a/testing/raptor/raptor/results.py +++ b/testing/raptor/raptor/results.py @@ -412,15 +412,11 @@ class BrowsertimeResultsHandler(PerftestResultsHandler): # bt to raptor names conversion = ( ("fnbpaint", "firstPaint"), - ("fcp", "timeToContentfulPaint"), + ("fcp", ["paintTiming", "first-contentful-paint"]), ("dcf", "timeToDomContentFlushed"), ("loadtime", "loadEventEnd"), ) - chrome_raptor_conversion = { - "timeToContentfulPaint": ["paintTiming", "first-contentful-paint"] - } - def _get_raptor_val(mdict, mname, retval=False): # gets the measurement requested, returns the value # if one was found, or retval if it couldn't be found @@ -544,12 +540,13 @@ class BrowsertimeResultsHandler(PerftestResultsHandler): if self.app and "fennec" in self.app.lower() and bt == "fcp": continue - # chrome currently uses different names (and locations) for some metrics - if raptor in chrome_raptor_conversion and _get_raptor_val( + # FCP uses a different path to get the timing, so we need to do + # some checks here + if bt == "fcp" and not _get_raptor_val( raw_result["browserScripts"][0]["timings"], - chrome_raptor_conversion[raptor], + raptor, ): - raptor = chrome_raptor_conversion[raptor] + continue # XXX looping several times in the list, could do better for cycle in raw_result["browserScripts"]: