Bug 1514752 Define hero user timing before performance entry is created r=rwood

1-line fix to hero element timing: the performance entry would show up as 'undefined' in profiles because the variable was defined later.

Differential Revision: https://phabricator.services.mozilla.com/D14746

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew Creskey 2018-12-17 22:40:43 +00:00
Родитель 4f8c2372b0
Коммит 96ae71fa3f
1 изменённых файлов: 1 добавлений и 1 удалений

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

@ -116,13 +116,13 @@ function measureHero() {
// mark the time now as when hero element received
perfData.mark(heroFound);
console.log("found hero:" + heroFound);
var resultType = "hero:" + heroFound;
// calculcate result: performance.timing.fetchStart - time when we got hero element
perfData.measure(name = resultType,
startMark = startMeasure,
endMark = heroFound);
var perfResult = perfData.getEntriesByName(resultType);
var _result = Math.round(perfResult[0].duration);
var resultType = "hero:" + heroFound;
sendResult(resultType, _result);
perfData.clearMarks();
perfData.clearMeasures();