We've just announced Flood Agent, a tool for cloud load testing and on-premise load testing using infrastructure you already have. Here's the transcript of a tutorial video I created showing you just how to use Flood Agent.
For more information:
[Product Page] Flood Agent
[Guides] Flood Agent
Here's the video:
In this video, I'm going to show you how to use Flood to start load tests on machines that you already have in your office and how to pipe those results to Flood in real time.
Running load tests on the cloud is a really easy way to scale up by using virtual machines instead of having to provision real ones. But what if you already have real machines that you'd like to use as load generators and you want to use Flood to orchestrate it all?
Well, we actually have a new tool called Flood Agent. Flood Agent is a cross-platform tool for running Flood load generators on your own infrastructure, whether that's on-premises or in the cloud. Today I'm going to show you how to download and install Flood Agent on both of these laptops that I already have and then turn those into Flood grids for you to run your load tests on.
This one is a Macbook Pro running macOS, and this one is a Dell Alienware laptop running Windows. All of the resources I mention in this video will have a corresponding link in the description below.
Step 1: Download Flood Agent
First, let's start with the Mac. You're going to need to download and install Agent. You can download it either from GitHub or just follow the instructions on our Guides page, and we'll have a series of commands that you can type into your terminal. This is that GitHub page, but I've already downloaded Agent to save us some time.
Step 2: Create Flood Agent configuration file
Step 2 is setting up the configuration file for Flood Agent.
The configuration file will tell Flood Agent two things: the first is which Flood account to use in order to run the test. This is going to allow you to be able to log into that account and manage those new grids on your own machines from the Flood interface.
The second thing we're going to set in the configuration file is the location of the tools that you want to use. If you already have Docker installed on your machine, you can optionally have Flood Agent use our Docker image of whatever tool you're using. In some situations, though, you'll want to use your own local tool installation. Maybe if there's a particular version that you want to run, or if there are certain plugins that you want to use. So since I already have JMeter installed on my machine, I'm going to go with the second option.
Setting your Flood API token
Now let's create the configuration file. The easiest way to do this is to just bring up the terminal and type `./flood-agent configure`. This is the Flood Agent configuration wizard, which will take you through the settings step by step. The first step is the token. The token that it's asking for is your Flood API token. Here's how you can get that.
First, log into your account on Flood. Once you're in, go to your profile on the upper right-hand corner here and click on API Access. Click down here on the button, Reveal Token.
You'll need to copy this entire thing starting with `flood_live`.
And then where it says to enter the token on your terminal token, paste the token there. I'm going to hit enter, and it's actually checking the token against the Flood API. Now, what this is going to do is give your machine the permission to access your Flood account on your behalf.
Okay, looks like it's saying the token is valid, so the next step is configuring JMeter. We're going to go ahead and do that since our script is going to be a JMeter script.
Choosing your load testing tool
This time, I'm going to say a local installation because I already have JMeter installed here.
Then, it'll ask you to enter the path for your JMeter installation. You'll need to copy the path of the folder containing your JMeter bin.
We can see here that Agent is saying that the JMeter installation looks good, and it's asking us whether or not we want to configure Gatling. I'm going to say no for now. And I'm also going to say no to Flood Element, although, of course, you could configure all three of these is you intend to run tests using all three.
It'll ask you if you want to write these settings into the configuration file, and you should say yes. Okay, now our configuration file is created.
Step 3: Check configuration settings
Step 3 is to do a check on our configuration settings. This will verify whether the API token is correct, whether we have access to start grids on that particular Flood account, and whether Agent can read the local installation of the tool we're using.
To do that, we're going to type `./flood-agent` check like this.
You should see messages like these that say connectivity ok. This means that we're ready to run a flood on this grid. But before we do that, let's get the Windows machine set up as well, so we can run a flood on both of them.
Steps 1-3 for Windows
The installation for Flood Agent on Windows is a little bit different because it's going to be an executable file that you just need to copy over into the directory you want it in. For brevity, I always like to rename that file to Flood Agent. I've downloaded Flood Agent onto the `C:\` directory in its own little folder here. Then I'll bring up a terminal window.
Configuring Flood Agent on Windows is almost the same as on the Mac, but note the backslash and the .exe: `./flood-agent.exe configure`. Again, we're being asked to enter the token.
We're going to hit enter. It says the token is valid.
We're being asked to configure JMeter. I'm going to paste in the directory of my local JMeter installation on this computer. Hit yes to let it write the config.
And then let's check that everything's configured correctly on this computer as well. Type: `.\flood-agent check`.
Looks like everything's set up correctly here, so let's get those grids started!
Step 4: Start a grid
In Flood terms, a node is a load generator. A grid is just a collection of nodes, and in general, you'll want one grid in one location. So we want both of these load generators or nodes on the same grid. Here's how you do that. Let's go back to the Mac.
To start a grid, we'll actually need a name for the grid, so let's call it askaflooder.
Type: `./flood-agent --grid askaflooder`.
Agent is now checking with Flood to see if it has the right permissions to set up a grid, and it'll actually start this one node, for the Mac, on Flood.
Okay, it looks like the grid has been started with one node on it so far. Now let's go back to the Windows machine and do the same thing.
Note the backslash and the exe. Type: `.\flood-agent.exe --grid askaflooder`. [Use the same grid name.]
All right, looks like that one's ready too. So now we should have one grid called askaflooder, and both of these nodes should be on it.
Your nodes, on Flood
Let's go and see what that looks like on Flood. From your Flood dashboard, go into grids. And there it is. Under standalone grids, we can see a grid called askaflooder, and there are two nodes on it, representing the two machines that I've got here.
But how do we actually run a flood on them?
Step 5: Create a new stream on Flood
For that, we'll want to go into the project we actually want to run a flood in. Click on the streams button, and then we're going to create a stream.
On this screen, we're going to design our test plan. I'm going to call this Flood Agent, and I'm going to upload a JMeter script that I already prepared beforehand. After that's done uploading, JMeter is already selected as the tool here, and we don't want any advanced parameters, so I'm just going to skip over to the launch screen.
Now, in the launch screen, we're going to be asked to select the infrastructure type. By default, Demand is selected; however, this time, we're going to select Hosted.
And look at that - when we click on the Grids dropdown menu, askaflooder, our grid of two nodes, is already selected.
Since I don't really want to run with many users, I'm going to put in 10 users per node, so we should have a total of 20. And we'll say that it'll run for 15 minutes.
Step 6: Run the flood
Then let's go ahead and click Launch.
And that's how you run a flood on your own infrastructure, including on-premises!
A note on choosing your infrastructure
Now, obviously, in this case, I just wanted to show you how to do it on a Mac and a Windows machine, but in reality, you probably shouldn't be running it on just spare laptops that you've got lying around.
You would want load generators that would ideally be as identical as you can get them to be. So you wouldn't actually be running on different operating systems like this; you would run maybe a host of Windows ones or a host of macOS ones or Linux ones. That way, you're reducing the variables that you're introducing into your load tests.
We're all very excited about the potential and flexibility that Flood Agent is going to bring to Flood. If you have any questions about how to do any of this, go through the description to find the links to our Guides, and you can always email us at firstname.lastname@example.org. Until then, happy flooding!