if we don't have Browsertime metrics, use WPT as backup

This commit is contained in:
soulgalore 2017-03-20 23:07:51 +01:00
parent 5cc1652a11
commit b9a5c1700f
2 changed files with 45 additions and 6 deletions

View File

@ -68,13 +68,31 @@ block content
tr
td RUM Speed Index:
td #{d.browsertime.pageSummary.statistics.timings.rumSpeedIndex.median}
if !d.browsertime && d.webpagetest
tr
td Render (first view):
td #{d.webpagetest.pageSummary.data.median.firstView.render}
tr
td Speed Index (first view):
td #{d.webpagetest.pageSummary.data.median.firstView.SpeedIndex}
tr
td Visual Complete 85% (first view):
td #{d.webpagetest.pageSummary.data.median.firstView.visualComplete85}
tr
td Last Visual Change (first view):
td #{d.webpagetest.pageSummary.data.median.firstView.lastVisualChange}
tr
td Requests:
td #{d.webpagetest.pageSummary.data.median.firstView.requestsFull}
.one-half.column
if d.browsertime && d.browsertime.pageSummary && d.browsertime.pageSummary.screenshots
- var width = options.mobile ? 150 : '100%';
a(href='data/screenshots/0.png')
img.screenshot(src='data/screenshots/0.png', width=width, alt='Screenshot of run 0')
img.screenshot(src='data/screenshots/0.png', width=width, alt='Screenshot of run 1')
else if !d.browsertime && d.webpagetest
a(href='data/screenshots/0.png')
img.screenshot(src='data/screenshots/wpt-1-firstView.png', alt='Screenshot of run 1')
include ./summaryBox.pug
if d.browsertime && d.browsertime.har

View File

@ -70,13 +70,34 @@ block content
tr
td RUM Speed Index:
td #{d.browsertime.run.timings.rumSpeedIndex}
if !d.browsertime && d.webpagetest
tr
td Render (first view):
td #{d.webpagetest.run.firstView.render}
tr
td Speed Index (first view):
td #{d.webpagetest.run.firstView.SpeedIndex}
tr
td Visual Complete 85% (first view):
td #{d.webpagetest.run.firstView.visualComplete85}
tr
td Last Visual Change (first view):
td #{d.webpagetest.run.firstView.lastVisualChange}
tr
td Requests:
td #{d.webpagetest.run.firstView.requestsFull}
.one-half.column
//- No good way to detect if we have screenshots or not right now for a run
- screenshotName = 'data/screenshots/' + runIndex + '.png'
- var width = options.mobile ? 150 : '100%';
a(href=screenshotName)
img.screenshot(src=screenshotName, width=width, alt='Screenshot')
if d.browsertime
- screenshotName = 'data/screenshots/' + runIndex + '.png'
- var width = options.mobile ? 150 : '100%';
a(href=screenshotName)
img.screenshot(src=screenshotName, width=width, alt='Screenshot')
else if !d.browsertime && d.webpagetest
- screenshotName = 'data/screenshots/wpt-' + (Number(runIndex)+1) + '-firstView.png'
a(href=screenshotName)
img.screenshot(src=screenshotName, alt='Screenshot')
if d.browsertime && d.browsertime.run && d.browsertime.run.har
include ./waterfall/index.pug