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
This commit is contained in:
Sean Feng 2020-10-23 19:47:20 +00:00
Родитель 10786ede6c
Коммит e04febfc19
1 изменённых файлов: 6 добавлений и 9 удалений

Просмотреть файл

@ -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"]: