我在docker配置上通过sitespeed在webpagetest下运行。下面是命令参考。
docker-compose run sitespeed.io site_urls.txt --graphite.host=graphite --mobile --firstParty .fabhotels.com --network=3gslow -c 3gslow --webpagetest.key=<Webpagetest API Key> --webpagetest.runs=1 --webpagetest.useragent="Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Mobile Safari/537.36" --webpagetest.location=ap-south-1:Chrome.3GSlow
我的输出低于错误。
Unhandled rejection TypeError: Cannot read property 'browser_name' of undefined on line 48
at eval (eval at wrap (/usr/src/app/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:159:71)
at template (eval at wrap (/usr/src/app/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:1767:3)
at Object.renderTemplate (/usr/src/app/lib/plugins/html/renderer.js:27:37)
at Promise.resolve.map.url (/usr/src/app/lib/plugins/html/htmlBuilder.js:248:37)
From previous event:
at HTMLBuilder.render (/usr/src/app/lib/plugins/html/htmlBuilder.js:173:69)
at Object.processMessage (/usr/src/app/lib/plugins/html/index.js:201:35)
at queue.process.message (/usr/src/app/lib/core/queueHandler.js:208:32)
at drainItem (/usr/src/app/node_modules/concurrent-queue/index.js:96:21)
at Immediate.drain [as _onImmediate] (/usr/src/app/node_modules/concurrent-queue/index.js:77:84)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)
at processImmediate [as _immediateCallback] (timers.js:745:5)
调试后,我发现webpagetest.har给出的是来自网页测试API的响应
{
"log": {
"version": "1.1",
"creator": {
"name": "WebPagetest",
"version": "18.10"
},
"browser": {
"name": null,
"version": null
},
"pages": [
{
"startedDateTime": "1970-01-01T00:00:00.000+00:00",
"title": "Run , First View for ",
"id": "page___",
"pageTimings": {
"onLoad": null,
"onContentLoad": -1,
"_startRender": null
}
}
],
"entries": []
}
}
我正在使用SiteSpeed.io的最新Docker镜像
由于我无法弄清API输出空值的可能原因是什么?
答案 0 :(得分:1)
问题在请求参数中,更新
-webpagetest.location到ap-south-1:Chrome
并应用慢速3G过滤器
-webpagetest.connectivity =“ 3G”