Yasmeen
Yasmeen

Reputation: 819

No Response Data When using Cassandra JMeter

I am new to JMeter and Cassandra and trying to use Apache Jmeter Cassandra Plugin for Testing Purpose

https://github.com/Netflix/CassJMeter/wiki

By following the steps given there i was able to configure JMeter Cassandra Plugin.

  1. In the JMeter Console I created a New ThreadGroup->CassandraProperties and specified all the Cassandra related properties in there. enter image description here

  2. Added SchemaProperties as below. enter image description here

  3. Added a Cassandra Get Range Slice enter image description here

But when i start testing i get a success response in the sample result but my response data is empty enter image description here

My Users table is not empty using cql i can query data, its schema is as follows:

CREATE TABLE users (
  user_name text,
  gender text,
  password text,
  PRIMARY KEY ((user_name))
) WITH
  bloom_filter_fp_chance=0.010000 AND
  caching='KEYS_ONLY' AND
  comment='' AND
  dclocal_read_repair_chance=0.100000 AND
  gc_grace_seconds=864000 AND
  index_interval=128 AND
  read_repair_chance=0.000000 AND
  replicate_on_write='true' AND
  populate_io_cache_on_flush='false' AND
  default_time_to_live=0 AND
  speculative_retry='99.0PERCENTILE' AND
  memtable_flush_period_in_ms=0 AND
  compaction={'class': 'SizeTieredCompactionStrategy'} AND
  compression={'sstable_compression': 'LZ4Compressor'};

So when i execute the Jmeter console i should get the 100 count result and some response data too right? I am stucked here and unable to understand ...any help will be appreciated.

Upvotes: 5

Views: 663

Answers (1)

Ori Marko
Ori Marko

Reputation: 58862

You can check blazemeter tutorial on scripting Cassandra in JMeter:

  1. download the driver jar file. After that you can add the downloaded jar file to JMeter’s classpath

  2. add Cassandra dependencies and add them to the JMeter classpath as well

  3. Add -> Sampler -> JSR223 Sampler

  4. Submit your request

for example:

import com.datastax.driver.core.Session;
import com.datastax.driver.core.Cluster;
Cluster cluster = Cluster.builder().addContactPoint("127.0.0.1").build();
Session session = cluster.connect("test_keyspace");

def results = session.execute("SELECT * FROM users");

session.close();
cluster.close();`

you can achieve Cassandra load testing via JMeter, independently of the Cassandra version you have. By using Groovy scripting language you don’t need to care about which Cassandra functionality is supported by JMeter, because you can implement the operations yourself

Upvotes: 0

Related Questions