Categories
Gatling

Introduction to Gatling

We are living in the world of technologies, it changes the way we work, the way we look at the things. We search queries in google, do shopping online, share a moment in Facebook, chat with our childhood friends irrespective of where they live. Everyone likes if the tasks are simplified or automated by online solutions and gives more sophistication on our needs. Hence it is more important to design the web application by considering the performance factors such as concurrency, response time, fault tolerance, scalability. Though there are so many load testing tools available in the market, JMeter and Gatling are considered as widely used performance testing tools. Both JMeter and Galing are open source tools , Gatling also has enterprise version ‘Gatling Frontline’ “https://gatling.io/gatling-frontline/

We had seen already about JMeter and how it helps QA to identify performance bottlenecks without worrying much on coding part as JMeter offers built-in components like Logical controllers, Samplers for protocols like http,ftp,Soap,Jms etc…, listeners for reports, Config elements like CSVDatasetConfig for customizing user data, Pre-Processors , Post-Processors such as Regex-Extractor, JMXMon for Monitoring the heap parameters of the Web application. Indeed JMeter is easy to use and it servers the purpose of finding the performance bottleneck, we have to agree on the fact that it has JMX format which makes script changes challenging.

Introduction on Gatling
Gatling is developed and maintained by Stephene Landelle. Gatling is well known for its speed and performance as it is built on AKKA Engine, Scala language based. Gatling works on asynchronous model. Gatling does not lock the thread at the jvm level, so there is no one user per thread concept. After thread completes it tasks , it will be released and takes the next task. Currently Gatling supports more on HTTP protocol , also they support JMS protocol.

As per https://gatling.io/performancetesting ,it has code-like scripting  which can help in continuous delivery pipeline. Gatling Domain Specific Language (DSL) helps easy-to-read for everyone.

Download Gatling from the following location, Latest version is Gatling 2.1.7
http://gatling.io/#/download

When you open Gatling you can see the following folders

bin
It has gatling recorder and gatling to run simulations for both windows and linux

conf
Gatling configuration files are placed here

lib
lib folder has Gatling Jar files , Scala libararies, netty libraries

results
results folder basically consists of simulation results, html files

target
where simulation class files can be found

user-files
user files are placed under data folder of this user-files directory.
simulation files are inside /user-files/simulation folder.

Categories
Bigdata

Load Testing Apache kafka using Kafkameter

You can refer overview of Kafka here . For Installation and configuring Kafka , refer the previous post : Configuring Apache Kafka

Step 1

Go to githup and download kafkameter
https://github.com/BrightTag/kafkameter

Step 2

Follow the Steps for building the kafkameter.jar

Step 3

Place the generated jar in $JMETER_HOME/lib/ext folder

Step 4

Restart jmeter

Step 5

Add Threadgroup->Samplers-> Javarequest

Step 6

Configure Input parameters, like hostname , kafka topic that you created already

Step 7

Run Jmeter test and verify the same message is consumed by Kafka consumer.

Refer the below screenshots

 

 

Kafka Parameters

 

Sending message to Kafka Consumer

 

Message Consumed

Categories
Bigdata

Configuring Apache Kafka Environment

Kafka is used widely in social networking websites because of its performance. Refer Kafka introduction for more information.  Here i’m going to show how to setup Kafka in simple 8 steps.

Step 1

Download Kafka from Apache Website:
https://www.apache.org/dyn/closer.cgi?path=/kafka/0.8.2.2/kafka_2.9.1-0.8.2.2.tgz

Step 2

Untar downloaded archive.

Step 3

cd kafka_2.9.2-0.8.2.2

Step 4

Start zookeeper which is used for Synchronizing producers and consumers.
bin/zookeeper-server-start.sh config/zookeeper.properties

Step 5

start Kafka Server
bin/kafka-server-start.sh config/server.properties

Step 6

Create topics for Kafka producer and consumer
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic kafkatopic2

Step 7

Start kafka Producer and type some messages
bin/kafka-console-producer.sh --broker-list localhost:9092 --sync --topic kafkatopic2

Step 8

Start Kafka Consumer and observe that the messages you typed in #Step 7 , getting consumed.
bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic kafkatopic2 --from-beginning

So you have successfully setup the kafka . We will try to add more consumers and producers in next post.

 

Categories
Bigdata

Apache Kafka – Introduction

Apache Kafka is the distributed messaging system which serves as a substitute for traditional JMS messaging systems in the world of BIG-DATA. Another way to describe Kafka as per Apache website is “Apache Kafka is publish-subscribe messaging rethought as a distributed commit log”. It was originally developed by LinkedIn and later on became a part of the Apache project.

Features of Kafka are
  • Faster
  • Scalable
  • Durable and
  • Distributed by Design.

Kafka has some differences when compared to other message brokers like RabittMQ, Websphere MQ . One of the best-known advantages is its performance. It consumes data in its own way.

Components of Apache Kafka

There are five important components in Kafka as given below

Kafka COMPONENTS

Kafka can have multiple producers and consumers and work as a cluster in a distributed model.

Kafka works on a publisher-consumer mechanism. Kafka maintains feeds of messages in  “topics“, processes which publish messages to a Kafka topic is named as “Producers“, processes that subscribe to the topic and process the published messages is called as “Consumers“. Kafka is run as a cluster comprised of one or more servers each of which is called as a broker.

Kafka Use cases
  • Messaging: Replacement for a more traditional message broker, Kafka has better throughput, built-in partitioning, replication, and fault-tolerance.
  • Website Activity Tracking: Real-time processing, real-time monitoring, and loading into Hadoop or offline data warehousing systems for offline processing and reporting.
  • Metrics: Aggregating statistics from distributed applications to produce centralized feeds of operational data.
  • Log Aggregation: Collects physical log files of servers and puts them in a central place (a file server or HDFS perhaps) for processing

This is just an introduction about Kafka, please refer Apache-site documentation for detailed documentation.

Categories
Jmeter Performance Testing

How to Transfer/Refer Jmeter Variables from one Thread Group to another Thread Group?

In many situations, we encounter in referring the variables from one thread group to another. Even I found myself every time I end up in searching for the solution. Finally, I have decided to write it here, there are many ways to transfer variables, I preferably choose the following method.

1) Set up Thread Groups
2) Add a “BeanShell Assertion” to the sampler where you are extracting the value
3) In the Script area of BeanShell Assertion specify as
${__setProperty(SG_Id2,${SG_Id1})} where SG_Id2 is a variable in which we are storing the value of
SG_Id1 , so that we can refer this value anywhere in the testplan across all the thread groups.
4) Now go to next Thread Group sampler where you want to pass the value and give as
${__property(SG_Id2)}
5) Now run the test and check the value passed from one thread group to another thread group

Categories
technews

Introduction to Elasticsearch

Elasticsearch is an Open Source  (Apache 2), Distributed search engine built on top of Apache Lucene. It allows you start with one machine and scale to ‘n’ number of servers with high availability.

Elasticsearch makes it easy to run a full-featured search server. It can be setup in lesser than five minutes. In this blog I’ll show how to:-

  • Install and run elasticsearch.
  • Indexing data.
  • searching
Installing and running Elasticsearch
  1. Download and unzip the latest version of Elasticsearch from elastic.co website.
  2. Go to the extracted folder, and Run bin/elasticsearch  on Unix or bin/elasticsearch.bat  on Windows, your terminal will be showing something like below.

elastic_9200_terminal

3.   Open web browser and point the url to http://localhost:9200/ , you should see something like below

elastic_9200

Indexing data

There are to main ways in adding data to elasticsearch.

  1. json over HTTP
  2. Native client.

Here we are using the curl command to insert data into elasticsearch

$ curl -XPUT ‘http://localhost:9200/twitter/tweet/1’ -d ‘{

“user” : “kimchy”,

“post_date” : “2009-11-15T14:12:12”,

“message” : “trying out Elasticsearch”

}’

the result of the above index operation is:

{

“_index” : “twitter”,

“_type” : “tweet”,

“_id” : “1”,

“_version” : 1,

“created” : true

}

Categories
technews

Illustration of MITM attack

MITM-diag
MITM illustrated
Categories
technews

Gif: Illustration of Manual transmission.

Here’s a gif, from internet illustrating manual gear transmission.

How_Manual_transmission_works

Categories
Windows

Installing .NET Framework 3.5 on Windows Server 2012 and Windows Server 2012 R2

There might be requirements of installing .Net Framework 3.5 in Windows Server 2012 and Windows Server 2012 R2, and you will most likely run into problems while installing it.

If you are trying to install .NET Framework 3.5 from the Server Manager GUI, you will see this when installing the feature:

“Do you want to specify an alternate source path? One or more installation selections are missing source files…”

Confirm

 

 

To solve this, you can either:

1. Go to a command prompt and enter this:

dism /online /enable-feature /featurename:NetFX3 /all /Source:d:sourcessxs /LimitAccess

Note: Source should be the Windows installation disc. In my case, this was located on D:

command

2. Go down to “Specify an alternate source path” and enter “d:sourcessxs” as the path.

addroles

addroles

Now you can proceed with installation.

Categories
Jmeter Performance Testing

How to execute a test continuously for specified duration without bothering no. of times using JMETER?

Scenario:

Do you have the following scenario to execute by Jmeter and not able to find the solution?

Having HTTP Request / REST Request in a test plan, required to execute the test for 1 hour duration without bothering repetition , and to

  • Find the application robustness and consistency to bear max load?
  • Find no. of requests application can handle for the specified duration?

and you would have

  • tried giving in scheduler but not worked as it executes for the number of threads specified In thread group.
  • tried giving in Duration but not worked. So what is next?

Solution:

  • Check ‘Forever’ check box in Thread group
  • Give Duration as ‘3600’ in Scheduler section of Thread Group

image

Enjoy Testing  Smile