Getting started with Gatling
Gatling was found by Stéphane Landelle in 2015, Gatling is a open Source load and performance testing framework. Gatling is created based on programming languages like Scala, Akka and Netty.
It is mainly developed to check and analyze performance of web application, and its application is found in various fields of software industry. Despite the fact that Gatling has emerged much after similar softwares such as JMeter and LoadRunner evolved,
Gatling is able to cope up with all the necessary requirements to run most of the protocols.
Some important terminologies while getting started with Gatling:
- Simulations: The simulation files contains different scenarios of test, its parameterization and injection profiles.
- Scenarios: A scenario consists of series of requests.
- Group: Group can be used as a sub-division of scenarios
- Requests: Gatling is able to initiate complex user behavior
- Injection Profile:A injection means number of virtual users an user which can be injected and how they are injected.
Performance of web applications:
Performance of web application is nothing but how efficiently/fast the application reacts to the user actions.
Performance is the responsiveness of the application for the user request.
The actions/requests could be in the form of clicks or setting values or displaying the UI elements in the browser with respect to UI. At the same time, we can also test the performance of the API by raising the requests.
Understanding the performance. There are different metrics which are used for analyzing the performance of the web application.
- Response time: Time taken for the system(web application in this case) to respond to any event.
- Throughput: It is the flow of data or information flowing through a process.
- System availability: It is the probability that the system is performing up to the mark when needed to.
- Requests Rate: No of request handled per second.
- Resources Consumption: How much system resource is being consumed.
Sample Output of Gatling
Below are some points, about why should we use Gatling:
- Gatling is written in Scala, so it is platform independent.
- Gatling test can run smoothly on local machines and cloud servers.
- We can get the source code of the tests in Scala programming language without much effort.
- Test metrics are created automatically without additional plug-ins.
- Usage of RAM and memory are minimal with Gatling.
Supported Technologies by Gatling
- Web Sockets
- Server-Sent Events
Below are few points showing how Scala is related to Gatling:
- After the execution of the test, Gatling provides with a Scala code as it's output.
- Since, the output is a source code, it becomes helpful any programmer to apply some techniques like factoring, which gives Gatling an added beauty
- In Scala all the elements, even the functions are also objects, which means better way of inferring decisions while, analyzing the Gatling test report
- Scala is a purely object oriented language and similar to Java, so a Java programmer need not study Scala in detail while operating with Gatling output
- Scala provided Gatling an output which is mostly an intelligent input for different systems, for analyzing output.
- The test report of Gatling is the performance test of an web-application or related systems, that is why it is mandatory that no error occurs during the creation of the output, which is assured here by Scala
- Since Scala is static in nature, it assures less dynamics in the source code output.
- Free and Open Source
- Gatling uses a very efficient way of handling thread, Gatling's engine is designed based on Akka.
- Gatling can create multiple virtual users using a same thread.
- Gatling in the only load testing tool which can make use of Async HTTP Client.
- Gatling requires less memory compared to other load or performance testing tools.
- All the test-parameters are ready-made at the end of the test, no need for different plug-in.
- Source code of the test can be created and hence, can be analyzed in customized manner using different IDEs.
- The codes are mostly in the human understandable format, which can be handled by non-technical person also.
- Gatling provides a very straight-forward way for performing assertions in many ways.
- The testing scenarios are automatically pipelined.
- Only fundamentals of JAVA is required to understand the Scala program created by Gatling
There are disadvantages of using gatling, some of the disadvantages can be summarized as follows:
- Nothing other than no of request, status and time elapsed can be seen during the execution.
- Different support-system such as Taurus should be used to monitor minute details during the execution time.
- Distribution of load may not be that easier and it's a bit lengthier.
- Not all protocol supported by Gatling, only handful of protocols can be handled.
- It's not possible to monitor the OS parameter during the test, and cannot be decided whether it's causing any bottleneck
- Apache JMeter: This is also a good load and performance testing tool based on Java, and has uses in wide variety of protocols
- Locust: This load testing tool is written in python and can flood your system with a million request. This is also a open source tool.
- LoadRunner: This is a performance testing software which can simulate thousands users and can later analyze the performance of the application
- Gatling is applicable to some listed protocols only, where JMeter can be used for any protocol.
- Gatling uses less memory as compared to JMeter
- Gatling is easier to operate, whereas JMeter is a bit complex to analyze
- Gatling Produces Scala Code which can be used in our way of uses, which is not the case of Gatling
- Gatling can use of Async HTTP Client, where JMeter cant
- Gatling handles cookies and cache by default, whereas JMeter does not
- Gatling's Scala code can be used by different IDEs to infer different results, not in JMeter
- Gatling is more powerful in case of using resources than JMeter
- Gatling has a expressive DSL for test development, not in the case of JMeter
- Gatling has notable support of HTTPS protocols and so also be used for JDBC and JMS load testing, where in JMeter these two protocols cannot be used
- Gatling cannot use multi-threading and cannot allow concurrent sampling of functions, where JMeter can.
- Gatling does not offer the facility of viewing all parameters status during execution, and an additional tool like Taurus may be helpful, but in JMeter it is of ease.
- Gatling uses Scala, while JMeter uses Java purely.
- LoadRunner has a important feature called VUGen(Virtual User Generator) which can easily record steps that the user performs to test an application, but its not available in Gatling.
- Gatling can use plug-in like Taurus which can monitor the test parameters in the time of testing, whereas in the case of LoadRunner, this is inbuilt.
- LoadRunner offers the facility to control all the virtual users from a single dashboard, this is also the case in Gatling, just the number of Vusers is reduced.
- LoadRunner may be applicable in wide environment just like Gatling, just it has wider ease of access in different platform.
- LoadRunnder can use its single load generator to create almost 1000 virtual Users.
- LoadRunner uses multiple protocol, and also multiple script protocol can be used in LoadRunner, whereas not in Gatling.
- LoadRunner works with of CRM/ERP systems offered by Oracle, PeopleSoft, SAP and Siebel, but not Gatling
- In LoadRunner the monitoring and analysis interface is much user friendly and easy to understand than Gatling
- LoadRunner, when used wisely can give us an accurate picture of end-to-end system/application performance, while Gatling gives the same only after the termination of the test.
chercher.tech. Do not dare to reproduce any material from this website and republish through any means for commercial purpose.