{"id":13475450,"url":"https://github.com/pod4g/hiper","last_synced_at":"2025-05-15T00:10:56.496Z","repository":{"id":46512711,"uuid":"135846537","full_name":"pod4g/hiper","owner":"pod4g","description":"🚀 A statistical analysis tool for performance testing ","archived":false,"fork":false,"pushed_at":"2020-07-20T13:57:25.000Z","size":47,"stargazers_count":2702,"open_issues_count":15,"forks_count":168,"subscribers_count":64,"default_branch":"master","last_synced_at":"2025-04-06T18:14:18.442Z","etag":null,"topics":["analysis","audits","broswer","cli","frontend","headless","network","pages","pagespeed","performance","statistical","testing","tool","web","webpages","websites"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pod4g.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-02T19:32:04.000Z","updated_at":"2025-03-16T22:59:42.000Z","dependencies_parsed_at":"2022-09-12T20:52:44.808Z","dependency_job_id":null,"html_url":"https://github.com/pod4g/hiper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pod4g%2Fhiper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pod4g%2Fhiper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pod4g%2Fhiper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pod4g%2Fhiper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pod4g","download_url":"https://codeload.github.com/pod4g/hiper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248782282,"owners_count":21160716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analysis","audits","broswer","cli","frontend","headless","network","pages","pagespeed","performance","statistical","testing","tool","web","webpages","websites"],"created_at":"2024-07-31T16:01:20.472Z","updated_at":"2025-04-13T20:43:46.233Z","avatar_url":"https://github.com/pod4g.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Tool","工具"],"sub_categories":["调试"],"readme":"**English** | [中文](./README.zh-CN.md)\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"http://7xt9n8.com2.z0.glb.clouddn.com/hiper-logo-512.png\" alt=\"Hiper\" width=\"175\"\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e🚀 A statistical analysis tool for performance testing\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/circleci/project/vuejs/vue/dev.svg\" alt=\"\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\" alt=\"\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\" alt=\"\"\u003e\n\u003c/p\u003e\n\n## Hiper\n\nThe name is short for **Hi** **per**formance \u003cdel\u003eOr **Hi**gh **per**formance\u003c/del\u003e\n\n## Important\n\nHi guys, Please present your issue in English \n\n请使用英语提issue\n\n## Install\n\n``` bash\nnpm install hiper -g\n\n# or use yarn:\n# yarn global add hiper\n```\n\n## The output\n\nNotice: `It takes period (m)s to load ...`. the `period` means **This test takes time**. So -n go up and the period go up. not a bug\n \n![Hiper](http://7xt9n8.com2.z0.glb.clouddn.com/hiper9.png)\n\n## PerformanceTiming\n\n![timing](http://7xt9n8.com2.z0.glb.clouddn.com/PerformanceTiming.png)\n\n| Key                            | Value                                        |\n| :----------------------------- | :------------------------------------------- |\n| DNS lookup time                | domainLookupEnd          - domainLookupStart |\n| TCP connect time               | connectEnd               - connectStart      |\n| TTFB                           | responseStart            - requestStart      |\n| Download time of the page      | responseEnd              - responseStart     |\n| After DOM Ready download time  | domComplete              - domInteractive    |\n| White screen time              | domInteractive           - navigationStart   |\n| DOM Ready time                 | domContentLoadedEventEnd - navigationStart   |\n| Load time                      | loadEventEnd             - navigationStart   |\n\nhttps://developer.mozilla.org/en-US/docs/Web/API/PerformanceTiming\n\n## Usage\n\n```bash\nhiper --help\n\nUsage: hiper [options] [url]\n\n🚀 A statistical analysis tool for performance testing\n\nOptions:\n\n   -v, --version                output the version number\n   -n, --count \u003cn\u003e              specified loading times (default: 20)\n   -c, --config \u003cpath\u003e          load the configuration file\n   -u, --useragent \u003cua\u003e         to set the useragent\n   -H, --headless [b]           whether to use headless mode (default: true)\n   -e, --executablePath \u003cpath\u003e  use the specified chrome browser\n   --no-cache                   disable cache (default: false)\n   --no-javascript              disable javascript (default: false)\n   --no-online                  disable network (defalut: false)\n   -h, --help                   output usage information\n```\n\nFor instance\n\n```bash\n # We can omit the protocol header if has omitted, the protocol header will be `https://`\n\n # The simplest usage\n hiper baidu.com\n\n # if the url has any parameter, surround the url with double quotes\n hiper \"baidu.com?a=1\u0026b=2\"\n\n #  Load the specified page 100 times\n hiper -n 100 \"baidu.com?a=1\u0026b=2\"\n\n #  Load the specified page 100 times without `cache`\n hiper -n 100 \"baidu.com?a=1\u0026b=2\" --no-cache\n\n #  Load the specified page 100 times without `javascript`\n hiper -n 100 \"baidu.com?a=1\u0026b=2\" --no-javascript\n \n #  Load the specified page 100 times with `headless = false`\n hiper -n 100 \"baidu.com?a=1\u0026b=2\" -H false\n\n #  Load the specified page 100 times with set `useragent`\n hiper -n 100 \"baidu.com?a=1\u0026b=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\"\n```\n\n## Config\n\n#### Support `.json` and `.js` config\n\n1. **json**\n\n```javascript\n{\n   // options Pointing to a specific chrome executable, this configuration is generally not required unless you want to test a specific version of chrome\n   \"executablePath\": \"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\",\n   // required The url you want to test\n   \"url\": \"https://example.com\",\n   // options Cookies required for this test. It's usually a cookie for login information Array | Object\n   \"cookies\": [{\n      \"name\": \"token\",\n      \"value\": \"9+cL224Xh6VuRT\",\n      \"domain\": \"example.com\",\n      \"path\": \"/\",\n      \"size\": 294,\n      \"httpOnly\": true\n   }],\n   // options default: 20 Test times\n   \"count\": 100,\n   // options default: true Whether to use headless mode \n   \"headless\": true,\n   // options default: false Disable cache \n   \"noCache\": false,\n   // options default: false Disable javascript\n   \"noJavascript\": false,\n   // options default: false Disable network\n   \"noOnline\": false,\n   // options Set the useragent information\n   \"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\",\n   // options Set the viewport information\n   \"viewport\": {\n      // options\n      \"width\": 375,\n      // options\n      \"height\": 812,\n      // options default: 1 devicePixelRatio\n      \"deviceScaleFactor\": 3,\n      // options default: false Whether to simulate mobile\n      \"isMobile\": false,\n      // options default: false Whether touch events are supported\n      \"hasTouch\": false,\n      // options default: false Is it horizontal or not\n      \"isLandscape\": false\n   }\n}\n```\n\n2. **js**\n\nHaving a JS file for config allows people to use ENV variables. For example, let's say I want to test the site on an authenticated state. I can pass some cookie that is used to identify me through ENV variables and having a JS based config file makes this simple. For example\n\n```javascript\n\nmodule.exports = {\n    ....\n    cookies:  [{\n        name: 'token',\n        value: process.env.authtoken,\n        domain: 'example.com',\n        path: '/',\n        httpOnly: true\n    }],\n    ....\n}\n```\n\n``` bash\n# Load the above configuration file (Let's say this file is under /home/)\nhiper -c /home/config.json\n\n# Or you can also use JS files for configuration\nhiper -c /home/config.js\n```\n\n## Pain point\n\nAfter we have developed a project or optimized the performance of a project, \n\nhow do we measure the performance of this project?\n\nA common approach is to look at the data in the `performance` and `network` in the `Dev Tool`, record a few key performance metrics, and refresh them a few times before looking at those performance metrics,\n\nSometimes we find that due to the small sample size, the current **Network/CPU/Memory** load is heavily impacted, and sometimes the optimized project is slower than before the optimization. \n\nIf there is a tool, request web page many times, and then taking out the various performance indicators averaging, we can **very accurately** know the optimization is positive or negative. \n\nIn addition, you can also make a comparison and get **accurate data** about **how much you have optimized**. This tool is designed to solve the pain point.\n\n\u003e At the same time, this tool is also a good tool for us to learn about the \"browser's process of load and rendering\" and \"performance optimization\", so that we don't get wrong conclusions when there are too few samples\n\n## Roadmap\n\n1. Better documentation\n2. i18n\n3. Increase the analysis statistics of resource items loaded on the page\n4. Statistical reports can be generated\n5. Data visualization\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create new Pull Request\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n\nWelcome Star and PR\n\nCopyright (c) 2018 liyanfeng(pod4g)\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpod4g%2Fhiper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpod4g%2Fhiper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpod4g%2Fhiper/lists"}