If you are on OSX, and you trust binaries from the internet, you can grab the binary here ; otherwise clone the repo with the following command:.
To build the server, run:. And run the following command to start the server:. This server will listen on port You should see a page with:. Our example home page. There are two other endpoints exposed by our example server.
Now that we have an example server, we can create the Locust test file. For this example we can use the example provided by Locust in their quick start documentation. You can use the locustfile. Your locustfile. The Locust documentation and quick start documentation provides an explanation of the contents.
We highly recommend working through their docs to learn more. Now that we have our locustfile we can do a test. First ensure your example server is running:. Now, in a new terminal we will run Locust. We will pass it the name of our test file, locustfile. For this test, we will simulate 1 user and specify 1 for the hatch rate. Click the Start swarming button. You should now see something similar to the following in the terminal running example server:.
In the Locust UI you will see a list of the endpoints being hit. There should be no failures unless Locust is having issues connecting to your server. Install Docker for your environment using the directions on the Docker website.
We will run two containers: our service our golang example server and our Locust instance. Thankfully this is a simple process. The following command will create a custom Docker network named locustnw :.
You can inspect this network with the following command:. You can either build an image of our example server or you can pull an existing image down from Dockerhub. Dockerhub is a repository of docker images that you can push and pull images to and from. To build our example server run the following:. The -t argument tags our container with a name, goexample , in this case.
If you would like to pull the image down instead run:. Running our locust container is similar to the process we used for our example server. Once again we can either pull or build the container image. To build run the following:. This builds the Dockerfile located in our docker directory.
That file consists of:. This file is important for part 2 of our tutorial where we will run locust in a distributed mode. To pull the image :. We will briefly discuss one import part of the run. This is key for us to communicate across containers within our Docker network. With our container built, we can run it with a similar command as our example service. We pass the network name to ensure this container also runs on our custom locustnw network.
We also pass an additional argument: -e. This argument sets environment variables inside the Docker container. We also see how the custom Docker network and named containers allow us to use exampleserver as the host name versus attempting to find the containers IP address and passing that in. Summary Files Reviews. Features Define user behavior in plain Python code Distributed and scalable to thousands of users Web-based UI - cross-platform, easily extendable Can test almost any system Small and hackable.
Project Samples. Project Activity. Categories Testing. License MIT License. Follow Locust Locust Web Site. Mit einem Experten sprechen. User Reviews Be the first to post a review of Locust! Report inappropriate content. Thanks for helping keep SourceForge clean. X You seem to have CSS turned off. Briefly describe the problem required :. Upload screenshot of ad required :. Aug 10, Aug 8, Aug 1, Jul 28, Jul 16, Jul 12, Jul 5, Jun 27, May 17, May 12, May 4, Apr 4, Jan 28, Jan 26, Nov 16, Nov 13, Nov 4, Oct 15, Oct 12, Aug 28, Aug 22, Jul 7, Jun 28, Jun 5, May 25, May 16, Download the file for your platform.
If you're not sure which to choose, learn more about installing packages. Warning Some features may not work without JavaScript. Please try enabling it if you encounter problems. Search PyPI Search. Latest version Released: Nov 5,
0コメント