Software Performance Testing - II
In continuation of the earlier article on how important and crucial is the performance testing of the application, we are going to shed some light on how this can be achieved and performed for a SUT( System Under Test)
There are several tools available in the market that serves the test load generation tool which helps in generating load on the SUT. One of the most popular and open-source tools here is JMeter.
JMeter
JMeter is widely used across industries by enterprise and non-enterprise organizations to conduct the performance test of their application. JMeter offers a wide variety of features and provides several other advantages:
- Open source license: JMeter is totally free, allows developers to use the source code for the development
- Friendly GUI: JMeter is extremely easy to use and doesn't take time to get familiar with it
- Platform independent: JMeter is a Java desktop application. So it can run on multiple platforms
- Full multithreading framework. JMeter allows concurrent and simultaneous sampling of different functions by a separate thread group
- Visualize Test Result: Test result can be displayed in a different format such as a chart, table, tree, and log file
- Backend Listener: One of the key features is that it can be integrated into a backend listener such as TSDB(Timeseries Databases)InfluxDB or Graphite, which can store the data points in real-time.
- Highly Extensible: You can write your own tests. JMeter also supports visualization plugins allow you to extend your testing
- Simulation: JMeter can simulate multiple users with concurrent threads, create a heavy load against web application under test
- Support multi-protocol: JMeter does not only support web application testing but also evaluate database server performance. All basic protocols such as HTTP, JDBC, LDAP, SOAP, JMS, and FTP are supported by JMeter
- Record & Playback - Record the user activity on the browser and simulate them in a web application using JMeter
INFLUX DB
This is an offering from InfluxData - This is a time-series database that is specifically designed to handle time-related data and is used widely to test the application's performance aspect. It has become one of the references for developers and engineers willing to bring live-monitoring into their own infrastructure.
Time series databases work differently. Data are still stored in ‘collections’ but those collections share a common denominator: they are aggregated over time.
Time series database systems are built around the predicate that they need to ingest data in a fast and efficient way. Indeed, relational databases do have a fast ingestion rate for most of them, from 20k to 100k rows per second.
However, ingestion is not constant over time. Relational databases have one key aspect that makes them slow when data tend to grow: indexes.
When you add new entries to your relational database, and if your table contains indexes, your database management system will repeatedly re-index your data for it to be accessed in a fast and efficient way.
As a consequence, the performance of your DBMS tends to decrease over time. The load is also increasing over time, resulting in having difficulties to read your data.
Timeseries databases are optimized for a fast ingestion rate. It means that such index systems are optimized to index data that are aggregated over time: as a consequence, the ingestion rate does not decrease over time and stays quite stable, around 50k to 100k lines per second on a single node.
Few benefits of using TimeSeries Databases:
- Faster Ingestion Rate
- Immutable data: Once inserted in the database, a data point does not undergo any changes until it is expired or deleted. The data is typically log data with a timestamp and a few data points.
- Aptly fit for IoT applications
- DevOps Monitoring
- Data retention policy
- Client plurality: you do not have a simple server accessing the database, but a bunch of different sensors (for example) inserting their data at the same time.
- Data Consumption: Data consumption is often done via monitoring tools such as Grafana or Chronograf. Those solutions have built-in solutions to visualize data and even make custom alerts with it.
GRAFANA
Grafana is an open-source solution for running data analytics, pulling up metrics that make sense of the massive amount of data & to monitor our apps with the help of cool customizable dashboards. Grafana connects with every possible data source, commonly referred to as databases such as Graphite, Prometheus, Influx DB, ElasticSearch, MySQL, PostgreSQL, etc.
Grafana being an open-source solution also enables us to write plugins from scratch for integration with several different data sources.
The tool helps us study, analyze & monitor data over a period of time, technically called time-series analytics.
It helps us track the user behavior, application behavior, frequency of errors popping up in production or a pre-prod environment, type of errors popping up & the contextual scenarios by providing relative data.
A big upside of the project is it can be deployed on-prem by organizations that do not want their data to be streamed over to a vendor cloud for security & other reasons.
Over time this framework has gained a lot of popularity in the industry & is deployed by big guns such as PayPal, eBay, Intel & many more. I’ll talk about the industry use cases up ahead in the article.
GRAFANA DASHBOARD
This open-source framework takes care of all the analytics of our app. We can easily query, visualize, set up alerts, understand the data with the help of metrics.
The dashboard is pretty equipped, & continually evolving, to make sense of complex data. From displaying graphs to heatmaps, histograms, Geo maps. The tool has a plethora of visualization options to understand data as per our business requirements.
Most important features of Grafana
- Dashboard templating
- Provisioning
- Annotations
- Custom plugins
- Alerting and alert hooks
- Monitoring your monitoring
- Offers a wide variety of data source
To summarize, the toolset combination of Jmeter(load generation tool), InfluxDB(Timeseries database), and Grafana(Monitoring dashboards) provide a complete solution to execute the performance test of the API/Webservice which inturn help the scalability, reliability, and efficiency of the software under test.
Insightful