Performing API Load Testing with Artillery In Depth Intuition

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Hello friends Welcome to our Channel knowledge amplifier so today in this particular video we are going to explore how we can load test our API okay that is for example suppose our team has developed one particular API using Amazon API Gateway and before the production deployment we want to test it out by artificially generating traffic that whether the API and the backend system can work properly or handle the production level traffic or not for example 20 users per second concurrently hitting our API using get request or post request then how our API and back end will perform that if you want to do before production deployment that time this particular tool can be helpful for you and this is the official website of artillary doio never fail to scale so using this this particular system is trying to tell you that first you test your API before production deployment so that when when traffic will increase then your back end should able to support the traffic and it should scale automatically So based on this kind of production load testing by artificially generating the traffic using artillery and Etc you can tune your backend system to tackle or handle the expected traffic right so we are going to explore how to use artillery from scratch so for that first what I will do I will launch one is2 machine and in that Ubuntu system we will install artillery using this particular command okay right so here I will go to instance and then here launch instance and here artillery cluster I can give the name the machine I can choose UB to machine and here free T eligible one I can choose and then I can scroll below T2 micro let it be the keep your name I can choose this one and keep all other properties default more or less and launch the instance okay here we need to wait couple of seconds to make the instance in running State initially it will be in painting state so let's wait for a few second So currently our instance is in running state so let us try to enter in this particular ISS machine using put te so I'll paste the host IP I will choose the keyp file for authentication and I'll open this and and here login as to avoid timeout issue I will change the connection this particular setting to 10 second and here we have successfully entered in this particular ISS to and now what I will do I will execute some command to install artillery in it so all these codes I'll be providing in the description box or in the comment section so that you can also do the set up parall okay here I will exp all these comments so first we are installing node and then we are executing NVM version to see whether it is properly installed or not and because it is giving output that means it is installed properly and now here we are going to install our artillery and once it get installed we will execute artillery version to see whether it is properly installed or not so here it is installed so now I can execute artillery version and here you can see it is giving the proper output that means it is successfully installed you can even execute this kind of command just put some kind of text here and you execute this command it will try to show you with some colorful shape like here dinosaur kind of shape is telling knowledge amplifier so that means it is working and now we will start our testing so for testing any API first we need an API right so here I have already created one API so this API I have created using Amazon API Gateway but to start the artillery understanding you can take any API which is available in Google for free that also fine let me just show you the API and its back end so here I will open AWS Management console in a new tab and then here I will go to API geta so here you can see this is our API artillery test and if I go inside that here it is having one particular resource path called first demo within that we are accepting get request if you click on that it is basically the back end regarding Lambda function so let's see what this Lambda code is doing so I will open AWS Management console in a new tab and I'll go to Lambda and this is our Lambda back end basically very basic set this is the Lambda name and if You observe here you will see that it is getting triggered by our API Gateway okay and here this is the Lambda code let me just zoom this particular code little bit and here first what we are doing we are importing Json and pho we are creating the Dynamo DB client using boto 3 and here we are pitching one particular record from Dynamo DB which is having idal to 01 and we are returning that particular idea so you can even check our Dynamo DB so if I go to Dynamo here I can click on tables and here we are having a table called customer and if I click on explore table item here you will able to see that one customer is available with ID 01 the name is and whole name is two right so whatever Lambda will do whenever we will make API get request it will trigger the Lambda the Lambda will petch the record which is having idal to 01 from the Dynamo table which is having the customer and it will return the it right very simple API even if you want you can test it out so this is our main URL and along with that this is our resource PA so I just copy this particular main URL in Google and then I'll give a slash and I am basically executing my resource part that is first demo and I will hit and enter okay so when I'm executing here you can see it is rning status for 200 in the body part it has basically F the Dynamo data and is as simple as that okay right now suppose we need to understand that whether this particular API will able to handle the production traffic or not so for that what we will do we will artificially generate G request which will be matching our production through for example we got the business requirement that per second two concurrent users may be executing get request to this API and that we need to test it out so for that if we want to use artillary we have to write one yl file and that file will look like this what it is doing suppose the file name is first demo. EML as part of config in the Target you have to configure your actual API end point so let me try to edit this particular config file parall this one you can consider as template and here I am editing okay so first as I told you in the Target section you have to put your actual API end point so end point is this one point to be noted here I'm not putting the resource path which is first step because we can put that separately somewhere else I will tell that then here we are keeping another field called phase so phase is nothing but section of our API load tting for example in a production level system it is not like always the traffic will be constant or fixed sometime it will go up sometime it will go down so that if you want to artificially generate using artillary you can use the phase so because it is the first ml file we are creating so I have kept a very simple phase in this phase I have configured only two things one is duration one is arrival rate what is arrival rate two means arrival rate two is basically saying that two concurrent users will be coming per second and it will be requesting this particular API okay the duration is 5 second that means using these two combination we can say that for 5 Second and that each second two users will be making get request to our API this way we want to artificially load t Okay so total how many request we'll be making 5 Second total and two users per second that means total 10 request will be making in 5 Second to our this particular AP okay and now coming to scenario so in scenario what we have to configure that this particular API May accept get request post request if it is accepting post request then what is the Json payload we should send all this information we have to configure in the scenario section okay so here if you see we have kept only one scenario that is get request we are making to this particular end point so our Endo here we need to provide the resource path so our resource path is first demo I will just put that here okay so this become our first artillery yl file what it is saying that our our base URL is this one our resource path is this one here I need to make get request two users per second like that way for 5 second I need to test that is total 10 request I'll be making okay so now let's create this EML file I'll just do VI and then first demo. I will go to insert mode and then here I will paste my code okay it is done I will just do colon W and our code is now to run this particular artillery test we have to execute this code debug equal to http star this will make sure all the request and response whatever our artillery is sending to this API in the back end all the logs it will be printing in the console okay and then this is our main code artillery run and then here ourl file name so ourl file name is basically F.L so we have given this particular name here with complete one right so we are ready to test it out but before that let me open some cloudwatch logs so that we can inspect that artillery is really making the request okay so for that what I have done for this particular API I have enabled cloudwatch monitoring so here I will go to dashboard section and here you'll be getting a matrix called API calls I will open this in cloudwatch to view and here local time zone it is selected I am only interested in past 15 minutes data so here you can see in past 15 minutes count is nothing that means the API we have not hit for past 15 minutes okay and another Matrix I will open that is whenever our artill code will hit API API get will trigger Lambda the Lambda will basically scan our Dynamo table right so that particular read request how many it is coming in the Dynamo D table that also we will try to inspect using Cloud okay so here I will go to to explore table item and here we'll be having a monitor section here Cloud watch Matrix it is showing the first Matrix is redage so I will open this in cloudwatch two Matrix I'll be keeping side by side and here also I am only interested in past 15 minute data here you can see there is no such Dynamo to be read request here I can only check this particular consumed one and maybe first I can configure 15 minutes here if you see on 1313 I made a test so like that way it is graph coming but currently it is21 p.m. and near to that there is no such request as of now okay right so both metrics are open now we are ready to test our code so here to run the code I will just execute this command in the console so here it will print lot of thing let's wait for the code to finish and then I'll explain so here it is done once you get the summary report that means you can understand your load test is finished so let's scroll up and try to understand from the beginning so here we have executed our code in the artillery code we have mentioned that it need to make get request to this particular end point right so that's what Here If You observe it is doing request start some request it is making to this particular URL okay so here if You observe this is the complete URL it is making the request this is our actual API end point this is our stage name and this is our resource path right so this particular part after to artillery test from https we have configured in the Target section basically this one and then in the gate URL whatever we have configured that it appended in the end part and then it made a request right like how generally it works and then you can see method type is get and here whatever response it Achi achieved that also it has printed so here the response is nothing but from Dynamo TV table for the id01 whatever we were getting from directly hitting the API from Google Chrome that same response we are getting here with status qu 200 like that way each time we are getting the same response because the Lambda code is fixed it is not dynamically quering anything so for that here all this response and request will be almost same okay now let's go to the summary section here if you see in the beginning here it has written All Views finished so what is view view is nothing but virtual user okay so artillery in the back end is creating these users artificially as if the users are making request right so they are called virtual user and total time it took 7 second Here If You observe our code we ran for 5 Second maybe due to network traffic or for some reason it took two more second extra and the total time it is displaying 7 second but ideally you can consider whatever total face time we can configure inl that should be ideally equal to the total execution time okay now here let's try to understand some important components from here number one is HTTP request how many request do we made to that API that it is showing so as I told you for 5 Second and at each second two user that means total 10 request we are making so here you can see HTTP request 10 okay and then HTTP request rate what is HTTP request rate it is nothing but at what rate is making a request so ideally the request rate is 2 per second but for some reason it is showing three per second maybe Network traffic or some issue it just increased little bit so that is not a problem but you can understand HTTP request rate we can easily calculate using the phas part here because part second two request we are making so ideally it should be two but for some reason it can see almost same let's consider that much error and then here HTTP response so here we got response for all 10 data points and for all of them we got Response Code 200 that you can see from here okay HTTP do210 so 200 request means that is correct data and for all 10 request we are getting same response code 200 that means our API is successfully able to survive this load t Okay and then another important part is this response timing very important because it shows the statistics about our response like for example minimum time it took to 10day response maximum time we maybe sometime more interested in the mean value okay what is the average time the API is taking to send the response and here you can see it is taking only 379 MC which is very fast right so these are some important components number one is all view finished I hope you understood what is the meaning of view total time we can easily compute from the face section and then HTTP do quotes then dot status code for example you are getting 200 status code then here 200 will be coming suppose along with 200 you are getting some other status code that will come as mudo and it will basically show you number of codes received for that particular status code okay then the request rate it is self-explanatory that is rate in which the HTTP requests are done then HTTP request that is total number of requests done and then HTTP response okay these are some important summary components which we should have a clear idea while working with artillery T and now we can inspect the cloudwatch metrix also to view whether artillery really make any rep or not so earlier we have seen in our API G Count section we have got no data but now if I refresh here you can see that because we have tested recently that's why there is a increase in the count request okay and if I scroll my mouse pointer here you can see that at 120 p.m. it increased to 10 and currently it is 127 p.m. nearly 5 6 minutes ago only we did that testing so that means it is capturing that also and this particular graph is proving artillery really made the request even we can check the Dynamo Also earlier nearly at 1120 or something will observe no data point or no Spike now if I refresh here you will able to see that nearly at 120 p.m. there is a spike in this graph okay that is basically indicating that artillery has made a gate request to API API has triggered Lambda Lambda went to Dynam for scanning and as a result Dynam request we are observing a good Spike right nearly at the same time when we turn testing so this way we can perform load testing for our so I hope the primary concept is clear to you now let's go to little advance and that is our second demo. EML second EML file basically we are going to create and here the first part it is same in the second part in the phase section I made some twist and what is that in the first demo we made a constant of fixed request rate that is two users per second like that for 5 Second we are testing as I told you in production system the request rate fluctuates with time so let's try to artificially generate that fluctuation so here first what we are doing for the duration of 2 minute we are keeping arrival rate one that is for the first two minute each second one user will be coming then for the next two minutes I am artificially sending no request okay that is nothing I am simply making a pause for 2 minutes okay no request will be made for this 2 minute and then for the next two minutes I am doing a stress testing I increased the traffic by a very high amount that is three concurrent user per second and this traffic will be sustained for 2 minutes and these are our three stages first one user per second like that 2 minutes then for the next 2 minutes no traffic then for the next 2 minutes three users per second and the this part it is keeping unchange that is flow we are keeping get request only to our first demo resource part okay right so here I will go to VI second demo. and I will go to insert mode and then here I will paste my config I will do WQ and it is done now earlier how we have run we basically run directly this particular command and all the request and response whatever we were getting it was printing in conso now when we may be testing for our production system this is not the ideal way what we can do we can move all these logs to a particular log file and that we can use for letter analytics purpose and it is also not a very good practice to directly run some long running Port from puty directly because your puty might have some timeout issue or you need to keep your puty window open for the long duration that is not a good practice right because it might happen that you are testing your code for 2 three hours so to avoid such puty related problem we can run our code in the back end whether put is open or not it will run and then once the code is executed it will stop that's it okay so for that we can take help of no Hub command Okay so to do that what I will do first I need to put this particular yl file in some Sal script so here the Sal script name second demo Dosh I can keep and here I can go to insert mode to the C script and whatever code earlier I was executing from the console directly that I'll be putting in this cell script okay and then here I will give WQ that is done now to execute this particular Sal script I should be making sure I am giving 755 permission and then what we can do we can execute our noop Command what it will do it is basically calling our Sal scpt and whatever logs it will be generating it will send to Second demo. out file both the logs and the output dat right so this is what this Moab command will do whether we are keeping our putut the open or not that does not matter okay so here I am going to execute this particular command so before that let me just uh keep my quep also open so that we can see the logs directly from the W CP so here host name I can put the username is ubon to and the password I'll be choosing authentication the PPK file I'll configure and I'll click on okay and then login okay so here we are successfully able to enter in our2 using WIP and if I refresh here you can see we are currently having three files one is first demo. EML which we have already executed then the second demo. EML for our second round of testing and this is the sales SC okay till now this particular output file is not generated yet right so here I will execute this m have command first clear everything and here command I ex and here you can see our no have comment started it has basically given the P ID 3042 I will just save this if I need for future tracking and in the back end what actually happened it started writing all the logs in this particular file so let's see now currently that log file is still not there I will refresh and here you can see second demo. out this particular file created okay I can open this particular one and here it will start showing all the logs whatever artillery is making request and whatever respon it is getting all these things it started printing okay and in Middle it will will give some summary report also but this is not the absolute summary report only once the complete execution is done then it will give the final summary and these metrices are for a certain period only okay so this kind of thing you can see that currently it has made Seven request and setatus code for all of them we've got 200 like that way it is coming so here I can close this one that is not impacting much so what is our main point of interest is basically simulating variable traffic that is it is not a constant traffic right sometime it is one user per second and then it is getting increased to three users per second in the middle there is a 2 minute pause so ideally this is nothing but a production kind of scenario we are creating using programming so we will observe in our Cloud watch logs whether it is getting changed accordingly or not both the Dynamo usage as well as our API let this particular code run let's wait for five minutes because here it will take two minutes and then here 2 minutes 4 minute and here 2 minutes total actually it will run for ideally 6 minute so let's wait for 6 minute and once the code is done we will observe the logs and all other things okay pretty much 6 minutes is over now let's go to see the logs here all the summary report and all other request response got captured I can open that one and if I scroll completely below here we'll be having our summary report as usual here you can see all views finished that is all virtual users have executed that get request and total time it took 6 minutes why 6 minutes here if you see the total of phas is 6 Minute 2 minutes plus 2 minute plus 2 minute okay that is total 6 Minute right the HTTP CES 2480 how 480 is coming that is here one request part second like the 2 minutes so 2 minutes means total 120 request in 60 + 60 seconds right and then here 2 minutes it is ideal and then here for 2 minutes it is making three request per second right so I can open calculator and show you so here 2 minutes per second one users that is 2 multiplied by 60 here it is 120 user in 2 minutes and here Plus in 2 minutes that is basically 2 multiplied by 60 seconds and part second three users so multip by three if I do here you will get 480 so that's why here if you that total 480 codes we are getting 480 request are made and all request got successful okay that is HTP status c 200 is coming 480 and the response time if You observe the mean value is 34 millisecond right so that means it is pretty much fast so our API able to sustain this particular traffic also so now let's see whether this pH distribution we are able to observe in The cloudwatch Matrix also or not so if I refresh this particular one here you will able to see the metrix got last updated at 135 so maybe instead of 5 minute let me this to 10 second and we are getting this kind of graph what this graph is showing try to understand so initially we started our testing nearly at 1:33 p.m. and it executed some kind of traffic where the traffic was basically part second one user is coming and that payload we ran for 2 minutes so at 133 it got started it went up to 135 p.m. okay so in between that that particular load we made and then there was a 2 minute pause so here that we are getting no count and then again after 2 minutes that is at 137 p.m. here you can see the spike we are getting in the count section so this is how as per artillery yaml configuration we are observing the count graph in cloudwatch Also let's inspect our Dynamo DB so here if I refresh our Dynamo DB here also you will able to to see that same at nearly at 13233 p.m. one Spike started and then in the middle it got reduced because we were having a nothing time or sleep time kind of thing where no traffic or no request we were making and then again we are getting a very huge Spike because in the second phase we increased number of concurrent user that is initially it was one and then we changed to three that's why Here If You observe the first spike is having lesser height but the second spike is having higher hand right so as per artillery yl configuration automatically in the back end our cloudwatch matrixes are also getting reflected and I hope you understood this how to configure variable traffic using artillery very easily just using yl configuration we can achieve that and this particular load testing code you can run for couple of hour also for example one user part second this request you want to make for continuous two or three hours so all you need to do 38 that is basically indicating three hours like that way right and obviously if you are running the code for 3 hours keeping the puty open is not a good practice so better to opt for no Hub command and try to encapsulate your main artillery code ising Sal script and then execute no have command move all the logs in a specific file which you can inspect or analyze letter for understanding different events and summary statistics whatever arer generated right and the last case what we are going to observe as part of today's discussion is post request so first we understood simple get request with one single phase constant rate throughput then we explored variable length traffic and now it's time to test post request and mostly in post request we send some Json payload along with the request we don't simply make request right so here we will see that maybe in a CSV file all the request Json parameters are stored how we can read that CSV file and make a post request that we are going to explore in the case three okay so here for this particular discussion I have taken one particular URL let me show you that particular URL first so this is basically one website URL and here what I will do I'll go to inspect section and here I'll go to network section maybe here suppose I'm searching something maybe heart when I'm searching in the back end to generate this particular data it is making some post request and that you are getting in this search tab this is the request URL and post request basically it is making and in the payload section it is passing some amount of payload related to Medical code related stuffs okay and based on that it is getting this particular response what it is displaying in the front end cool so what we can do we can maybe keep all this payload section in a CSV file and then we can configure our EML file such that it will make post request to the Endo by reading the CSV file data okay so here this is the code for that but first let me show you that particular CSV file to have a clear understanding so here this is our CSV file where I have kept lot of data whatever is required to make this particular post request so here this is our CSV file if you see the column names do drf DX HCC search these are the four things only we need right we have seen let me just show you again so what I will do I will go to inspect section and then here maybe I will make some request and then if I go to network section here you can see we made a sear request the payload here it need DX HCC Do drf and search only those four things we have kept in our CSV file with some dummy data we have created this particular file which is having nearly 32562 records okay if you exclude the first right so how we can configure the IML so the first thing Target our Target basically base URL is this one and then here in the phase section we are again putting some fluctuation in the traffic for example initially for 2 minutes we are keeping arrival rate two users per second then for the next 1 minute I'm doing nothing and then for the next 10 second I'm making a stress testing and that time each second 32 users are coming okay so these are different phase of our testing in the pay section in the path so in path we can configure that from which CSV file it will read the data for making the Json post request so that path is basically this particular one within our ec2 we should be keeping our CSV file and that our artillery code will read and make the request so here as of now this particular file is in my windows let me move that to ec2 so here I will just simply drag and drop I reconnect and here it is uploaded in home to section this particular file is there so that we have configured then order is sequence so what I'm trying to say this particular CSV file you read sequentially and each row you pick up and use this data point for CH request okay so order sequence then load all true skip header true because in my CSV file the first chice header I don't want to make some post request with this particular data point so skip header true the limiter comma because this is comma separated file and then skip empty line also true then what are the fields we are having in our CSV file that you have to keep in proper order that is dosier drf DX HCC and search here if you see in that order only it is there dosier drf dxcc and search cool so I hope up to this you understood how to read the CSV file and then in the scenario section it is same like alar we are giving some name for our scenario and in the flow we are making a post request okay in the URL within our post request this is the resource part that is/ API SL search that's what we have seen Right Here If You observe the header this is the URL where https www.cc reference.com this is our base path so that base path we have configured here https col www.cc reference.com and then the resource part that is basically nothing but SL API SL search that we need to configure in this and apart from that for this post request we need to pass some header also and this is a very popular header generally what we use that is content type is application of Json so that one we are configuring like this way and what Json data I should be passing while making the post request so that you have to configure like this way do drf dxx such and that it will pick up using these kind of variables okay so these are all variable values these values it will be taking from the CSV F so like that way from CS file it will read the elements and for each row it will make a post request to this particular end point with the variable length tra right so I hope this particular P you understood now let me quickly create this particular file also so VI hard demo. yl and here I'll go to insert mode and here I will paste this particular code completely and then here I'll paste that sorry it got pasted two times I will just write and quit and first I and then here I'll do VI again sorry for this mistake and then insert mode I'll go I'll paste code okay only one time test it then p w okay so our EML code is updated now here for running this EML I will create another Sal script like how we did earlier vid demo Dosh and in this C script I'll be putting my artillary code Run Okay so this one I have configured and then I will light and quit that is also done we will basically give 755 permission to this particular Sal script that is also done and now we are ready to run our no Hub command this time we are moving all the logs to third demo. output file so let's see the status of our directory currently here third demo. third demo. is there but third demo output file is not yet created because we have not Lear the code yet right so here I will run this particular code and here it is started and this is the process ID 3154 I will save this for future reference if it is needed and because it is running using M Hub if you want you can basically close this particular puty also not at all a problem okay even you can close the WIP also I'm just keeping open to show you the loog file got created if I refresh here somehow you will see third demo. out and you can open this one to check whether it is making request or not so here it is making the HTTP request and for that it is getting the response also this is the Response Code like that okay right so that means our artillary code is started now again this particular code will take ideally 2 minutes plus 1 minute plus 10 second so that is total ideally 3 minute 10 second kind of hue it will take let's wait for that much second and then we will inspect the logs because here we have kept really very high traffic arrival rate 32 that is 32 concurrent users per second and that traffic we are running for 10 second so we might face some error code also not only our simple success scod 200 but apart from that if we able to artificially create some error code that also inspect in the summary section how it is coming up right so with that way you will have a good idea with artillery and again I telling you this is just a basic tutorial this can show you the door but documentation is the one which can help you in working through it and resolve all the issues so I will always suggest to go through the documentation also you will able to learn much more in depth the documentation link I'll be providing in the description box or in the comment section for your easy reference right so here if I just close this one here you will continuously see this particular file is getting updated so last it updated at 153 currently it is 155 so let's refresh and see is 155 continuously our artill code is running making request response all these things it is capturing the size also continuously getting increased but for some time you might observe some constant value because here for 1 minute duration we are doing nothing and then for next 10 second we are doing some stress test right and this is the way how we can run our long running API load testing codes just use Mo up so that you can close your putting and in the back end the process will be continuously running whether in the back end the process is running on not that you can easily understand from your ec2 cloudwatch matrices also so here this is the ec2 where artillery load testing code is running right I can go to the monitor section and here you can see the CPU utilization continuously the CPU is getting utilized that is basically nothing but an indicator that our code is running and then for some time it might show some zero value because we have given some s time and then again it might take some spine okay so here almost 3 minute 10 second is done now let's see our output file whether summary report got generated or not is downloading and let's scroll completely below and here we are getting our summary inut so here in the summary report you can see that again we got no error basically all the 560 request we got successful code 200 and why it is 560 request that calculation also we can do Here If You observe that this is our traffic right so let's calculate quickly how 560 Val is coming 2 minutes so for 2 minutes that is basically 2 multip by 60 second and each second two users are coming so multiplied by two okay that is 240 then for 1 minute we are doing nothing then for next 10 second total 32 users we are sending per second so 240 plus 32 * by 10 it is 320 right if I just do 560 and that's what here it is showing 560 request we made six request per second nearly and HTTP request total 560 the mean value is 2 second value we are getting as average which if in your case if it is pretty high you might need to to tune the back end and this is what the statistics we are buing let me do one thing what I will do I will enter in the put p and let me increase the traffic by more higher value just to show you some other ports also coming up and the login as UB to you can make and then here our code what we have created is basically third demo. EML so all I will do I will try to edit this particular file I'll go to insert mode and here for the 10c duration instead of arrival rate 32 I will give very high value maybe 50 request per second we are keeping okay and then here I will give WQ and quit that and then again I will run my NOAB command so here this is the Moab command I will run and here it is sh permission denied why permission denied because I think we have edited the file right that's why it might be let's see uh demo. output file this is the log let's open this log this is the earier code only it is having so here no have script output okay okay like I got the point so the reason is we should do sudu because we have installed within sud sudu so here let's just do Al or LT I can do just to double confirm whether the file got updated or not I can just this one and here you can see that 50 users we are send part second so the code looks good now I can Lear this particular code with hyra okay and again the logs I am printing to third demo. out or maybe here I can keep fourth demo for. output file and here our process started 3576 is our process ID and if I go to WIP here fourth demo. output file also got created okay and now this time we kept very high traffic so we should expect some other codes apart from Response Code 200 okay so here again you can see that from beginning the traffic is started let's wait for 3 minutes so nearly at 2:4 p.m. IDE it should be completed let's wait for that much time so almost it is 2: p.m. 4 minutes now we should able to see the summary report because the test ideally should take only 3 minute 10 second because here If You observe here 2 minute and then here 1 minute and then here 10 so total 3 minute 10 second so let's just open the logs scroll below and here you can see the total time taken is 3 minute 20 seconds almost very close only we were expecting 3 minute 10 second it is 20 seconds that is fine and now this time going to note that not only we got some success but here we got some timeout also and for 375 post request we got time out and for the rest 375 we got Response Code 200 okay so here if You observe the total request were made 740 how 740 is coming again we can do a simple mathematics so here I can clear everything and then here 2 minutes so 2 multiplied by 60 is second and each second two users are coming so multipli by two and that is 240 plus here there is no traffic we are making and then here for 10 second and each second we basically made 50 users so 50 multiplied by 10 that is 500 okay that is to 740 and that's what it is showing here 740 right but point to note error code also it is displaying so by default artillery expect the response within 10 second if the request is waiting more than 10 second then automatically it will make a timeout if I just scroll up somewhere I can show the timeout issue here you can see that request error time out ating request for 10,000 millisecond that is after 10 second artillery will think the back end is not going to respond and it will throw a timeout issue you can tune that and if in your case the business team is not comfortable for 10 second a time then you have to improve your backend system like those kind of further analysis you can do the mean value or average response time is 1 second 942 millisecond something like that right and this is all the statistics we are getting so this way we can easily generate post request for variable traffic by reading the CSV file and each time we can send different different request in the post end point and that way artillery can help us in load testing I hope you understood this this is all for my this video If you find this video helpful then please like share and comment subscribe our Channel if you have not subscribed till now and don't forget to press the Bell icon to get the notification of our latest videos thank you for watching
Info
Channel: Knowledge Amplifier
Views: 561
Rating: undefined out of 5
Keywords: Load Testing Made Easy: A Beginner's Guide to Artillery, Performing Load Testing with Artillery in a Nutshell, Performance Testing using Artillery, Create Efficient Load Testing With Artillery!, Load test your Serverless Apps, Load Test As A Service, A Guide to Load Testing APIs with Artillery, Artilary, AWS, API Load Testing
Id: CbLGJAFh27w
Channel Id: undefined
Length: 45min 26sec (2726 seconds)
Published: Sat Jan 06 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.