Open Source API Test Tool Hitchhiker v0.6 Update-Improved stress testing

Source: Internet
Author: User

Hitchhiker is an open-source, Restful API testing tool that supports multiplayer collaboration, supports schedule, data comparison, stress testing, support for upload script customization requests, can be easily deployed locally, and collaborates with your team members to test the API.

For more information, see: http://doc.hitchhiker-api.com/cn/introduction.html

Online experience: http://www.hitchhiker-api.com/, can be used try without login for free login use (online demo does not support stress testing and upload JS, virtual machine single core, Can't hold).

Here's a look at this update: Override stress test

Hitchhiker before the stress test node is a hitchhiker-node based on go, the early Stage Hitchhiker script function is not complex, not support uploading JS Library, async/await, and file read save, etc. The high concurrency of Go is very attractive, after doing the research, using Otto as the JS interpreter, can meet the script running logic at that time, so the use of go to do stress testing node, in the early is enough.

Later hitchhiker began to support more complex scripting features, such as the custom JS library, because many JS libraries in NPM are based on Nodejs, and the current go and Otto do not meet this need, unless a node process to execute the script, but this is too complex, It may be better to write directly using Nodejs, so the stress test points are rewritten using Nodejs after comprehensive consideration.

The stress tests after rewriting are integrated with the server, which means no additional programs are deployed and all existing scripting features are supported.

Pros and cons of both methods:

Go's high concurrency and goroutine make this pressure program very easy to write, performance is also very secure, the disadvantage is that the Hitchhiker script is JS, so go to execute these scripts more laborious, Therefore, the current pressure point based on go does not support the advanced features of the Hitchiker script.

Nodejs Write this stress test program is more laborious, need to manage multi-process, and inter-process communication, but also can not accurately control the number of requests for 1 seconds, that is, the parameters of the pressure test QPS to Nodejs pressure point is useless, but fortunately hitchhiker The server is also based on Nodejs, so the logic of request processing can be reused, and the API's stress test is inherently high IO, so nodejs performance is good. However, the NODEJS program currently does not support the distributed, will be added later, the main function has been completed.

A little comparison of the performance of the two, on a single machine is basically the same.

Currently based on the Nodejs version of the default, you can also choose Go, but go temporarily will stop maintenance, unless go has a node-based JS interpreter, then consider moving back.

Reorganize the request process

The previous request process was a bit messy, causing some problems not to be easily discovered, such as environment variables not being applied to the test script, so the code was reconstructed when the bug was changed, and the process was cleared:

Response Display Pictures

This is a friend on GitHub, before I did not think someone would use this tool to request the picture, so also did not pay attention to this piece, but someone use, indicating there is demand (more than one person), so realized this function, if the response header has image/* The picture is displayed directly instead of the picture content (garbled).

Modify a bug
    1. Content in global function disappears after switching modules

    2. Schedule in the request return is a picture, will cause json.parse failure, resulting in an exception, changed the picture only save the link, do not save the content

    3. The websocket of the stress test in the browser sometimes fails and retries are added.

    4. The timing of the schedule will be 1 minutes or so.

    5. The name will be reset when the requested method is changed

Follow-up plan

In the short term, it is mainly to add new testing functions, such as curl generation request, request generate code, etc., long-term one is a document, one is a mock, start to decide the next module according to requirements.

Github: https://github.com/brookshi/Hitchhiker, feel good words trouble Star support, thank you.

Open Source API Test Tool Hitchhiker v0.6 Update-Improved stress testing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.