Bug 1518999 - Use the same conversion for Chrome and Firefox for FCP r=sparky,perftest-reviewers
authorSean Feng <sefeng@mozilla.com>
Tue, 27 Oct 2020 16:13:24 +0000
changeset 554734 ea8ed7d8298aeb6115c5774865083dcf11ca1d23
parent 554733 412e728191535556e5514614ce1d01a226ac89b9
child 554735 4f179bf502cedd18bf16a625477d5902e4304c89
push id37898
push userabutkovits@mozilla.com
push dateWed, 28 Oct 2020 09:24:21 +0000
treeherdermozilla-central@83bf4fd3b1fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssparky, perftest-reviewers
bugs1518999
milestone84.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
--- a/testing/raptor/raptor/results.py
+++ b/testing/raptor/raptor/results.py
@@ -421,25 +421,21 @@ class BrowsertimeResultsHandler(Perftest
                }
            }
         """
         LOG.info("parsing results from browsertime json")
 
         # 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
             #
             # mname: either a path to follow (as a list) to get to
             #        a requested field value, or a string to check
             #        if mdict contains it. i.e.
             #        'first-contentful-paint'/'fcp' is found by searching
@@ -558,22 +554,23 @@ class BrowsertimeResultsHandler(Perftest
                         )
                         and bt in ("fnbpaint", "dcf")
                     ):
                         continue
                     # fennec doesn't support 'fcp'
                     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"]:
                         if bt not in bt_result["measurements"]:
                             bt_result["measurements"][bt] = []
                         val = _get_raptor_val(cycle["timings"], raptor)
                         if not val:
                             raise MissingResultsError(