好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

Hiper

Hiper 介绍

Hiper

可以看成? Hi ? per formance的缩写?或者? Hi gh? per formance的缩写

注意事项

请使用英语提issue

安装

npm install hiper -g

# 或者使用 yarn:

# yarn global add hiper

输出

注意:?It takes period (m)s to load .... 这个?period?是 运行本次测试所用时间 . 因此,-n 越大,这个数越大

性能 指标

Key

Value

DNS 查询 耗时

domainLookupEnd - domainLookupStart

TCP连接耗时

connectEnd - connectStart

第 一个 Byte到达浏览器的用时

responseStart - requestStart

页面 下载耗时

responseEnd - responseStart

DOM Ready之后又继续下载资源的耗时

domComplete - domIn tera ctive

白屏时间

domIn tera ctive - navigationStart

DOM Ready 耗时

domContentLoadedEventEnd - navigationStart

页面 加载总耗时

loadEventEnd - navigationStart

使用

hiper --help

Usage: hiper [options] [url]

令人愉悦的 性能 统计 分析工具

Options:

-v,--version 输出 版本号

-n,--count <n> 指定加载 次数 ( 默 认20次)

-c,--con fig <path> 载入指定的 配置文件

-u,--useragent <ua> 设置useragent

-H,--headless 是否使用无头模式( 默 认为true)

-e,--executablePath <path> 使用指定的Chrome浏览器

--no-cache 禁用缓存( 默 认为false)

--no-JavaScript 禁用JavaScript ( 默 认为false)

--no-online 禁用网络( 默 认为false)

-h,--help 输出 帮助信息

用例

# 当我们省略协议头时, 默 认会在url前 添加 `https://`

# 最简单的 用法

hiper baidu.com

# 如何url中含有任何参数,请使用双引号括起来

hiper "baidu.com?a=1&b=2"

# 加载 指定页面 100次

hiper -n 100 "baidu.com?a=1&b=2"

# 禁用缓存加载 指定页面 100次

hiper -n 100 "baidu.com?a=1&b=2" --no-cache

# 禁JavaScript加载 指定页面 100次

hiper -n 100 "baidu.com?a=1&b=2" --no-JavaScript

# 使用GUI形式加载 指定页面 100次

hiper -n 100 "baidu.com?a=1&b=2" -H false

# 使用指定useragent加载网页100次

hiper -n 100 "baidu.com?a=1&b=2" -u "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (Khtml,like Gecko) Chrome/66.0.3359.181 Safari/537.36"

配置

支持 ?.json?和?.js?格式的 配置文件

[b]json

{

// options 指向Chrome可执行程序,一般不需要配置此项,除非你想测试某个特定版本的Chrome

"executablePath": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",

// required 要测试的url

"url": "https://example.com",

// options 本次测试需要用到的Cookies,通常是 登录 信息(即你测试的 页面 需要 登录 ) Array | Object

"cookies": [{

"name": "token",

"value": "9+cL224Xh6VuRT",

"domain": "example.com",

"path": "/",

"size": 294,

"httpOnly": true

}],

// options 测试 次数 默 认为20次

"count": 100,

// options 是否使用无头模式 默 认为true

"headless": true,

// options 是否禁用缓存 默 认为false

"noCache": false,

// options 是否禁掉JavaScript 默 认为false

"noJavaScript": false,

// options 是否禁掉网络 默 认为false

"noOnline": false,

// options 设置指定的useragent信息

"useragent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (Khtml,like Gecko) Chrome/66.0.3359.181 Safari/537.36",

// options 设置视口信息

"viewport": {

// options

"width": 375,

// options

"height": 812,

// options devicePixelRatio 默 认为1

"deviceScaleFactor": 3,

// options 是否模拟成mobile 默 认为false

"isMobile": false,

// options 是否 支持 touch时间 默 认为false

"hasTouch": false,

// options 是否是横屏模式 默 认为false

"isLandscape": false

}

}

js

配置的js 文件 允许人们使用ENV变量。例如,假设你想在经过身份验证的状态下测试 站点 。你可以通过ENV变量传递一些用于标识你的cookie,有 一个 基于js的 配置文件 使这变得很简单。例如

module.exports = {

....

cookies: [{

name: 'token',

value: process.env.authtoken,

domain: 'example.com',

path: '/',

httpOnly: true

}],

....

}

# 载入上述 配置文件 (假设 配置文件 在/home/下)

hiper -c /home/con fig .json

# 或者你也可以使用js 文件 作为 配置文件

hiper -c /home/con fig .js

GitHub: https://github.com/pod4g/hiper

网站描述: 一个 性能 统计 分析工具,可让你网页 性能 提升 10 倍

Hiper官方网站

官方网站:

如果觉得 网站内容还不错,欢迎将 网站 推荐给程序员好友。

查看更多关于Hiper的详细内容...

  阅读:48次

上一篇

下一篇

第1节:remote-browser    第2节:zanePerfor    第3节:Postwoman    第4节:whistle    第5节:bombayjs    第6节:RegExr    第7节:fast-check    第8节:debugGap    第9节:RAP    第10节:Appium    第11节:AnyProxy    第12节:TestCafe    第13节:easy-mock    第14节:Jsfuzz    第15节:Browsersync    第16节:appium-desktop    第17节:perflink    第18节:statusfy    第19节:Yslow    第20节:jest-puppeteer    第21节:WebPageTest    第22节:enzyme    第23节:PhantomCSS    第24节:mocker-api    第25节:matchMedia.js    第26节:Sitespeed.io    第27节:Hiper    第28节:karmatic    第29节:Bagel    第30节:Macaca    第31节:Gremlins.js    第32节:JSONPlaceholder    第33节:dom-testing-library    第34节:DejaVue    第35节:JSDebugger    第36节:Phantom.js    第37节:puppeteer    第38节:chaijs    第39节:Airtest    第40节:Expect.js    第41节:supertest    第42节:Redom    第43节:intern    第44节:Google PageSpeed Insights    第45节:Pingdom    第46节:Sentry    第47节:service-mocker    第48节:Ava    第49节:Standard    第50节:testdouble.js    第51节:Blanket.js    第52节:cypress    第53节:F2etest    第54节:weinre    第55节:majestic    第56节:javascript-testing-best-practices    第57节:mocha    第58节:browserhacks    第59节:web-starter-kit    第60节:EasyMock    第61节:vConsole    第62节:cavy    第63节:Fundebug    第64节:augury    第65节:FrontJS    第66节:Jest    第67节:Nightwatch.js    第68节:tamperchrome    第69节:nightmare    第70节:airtap    第71节:strider    第72节:qunit    第73节:eruda    第74节:wpt    第75节:Chii    第76节:log    第77节:Cucumber    第78节:TagUI    第79节:uirecorder    第80节:Sinon    第81节:Protractor    第82节:Firebug    第83节:Casper.js    第84节:should.js    第85节:node-tap    第86节:jasmine    第87节:rewire    第88节:Karma    第89节:Zelos    第90节:tape    第91节:vue-devtools    第92节:FAutoTest    第93节:Fiddler    第94节:unexpected.js    第95节:avoriaz    第96节:vuetron