Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem inserting timestamp data in cassandra table using Jmeter. #10

Open
VishalMakadia opened this issue Apr 30, 2013 · 1 comment
Open

Comments

@VishalMakadia
Copy link

I am trying to insert data into cassandra table using jmeter with cassandra put sampler.This is my table schema in cassandra crated by cql-3 .

CREATE TABLE sensor3 (
sensor_id int,
time timestamp,
sensor_value text,
PRIMARY KEY (sensor_id, time)
) WITH COMPACT STORAGE AND
bloom_filter_fp_chance=0.010000 AND
caching='KEYS_ONLY' AND
comment='' AND
dclocal_read_repair_chance=0.000000 AND
gc_grace_seconds=864000 AND
read_repair_chance=0.100000 AND
replicate_on_write='true' AND
populate_io_cache_on_flush='false' AND
compaction={'class': 'SizeTieredCompactionStrategy'} AND
compression={'sstable_compression': 'SnappyCompressor'};

While using cassandra put sampler i define the following inputs.

Client Type : com.netflix.jmeter.connections.a6x.AstyanaxConnection

i have tried two ways to do the same but find different errors.

  1. In First case i have used the Inbuilt time function to get the current timstamp which is below

Cassandra Put Properties --

Column family : sensor3
Row Key : 1
Column Name : ${__time(yyyyMMdd-HHmmss,YMDHMS)}
Column value : ${__Random(1,1000)}
Column Serializer : DateSerializer
Value Serializer : StringSerializer
Key Serializer : IntegerSerialzer

Attaching Stack trace of problem :

ERROR: java.lang.IllegalArgumentException
java.util.Date.parse(Date.java:615)
com.netflix.jmeter.sampler.AbstractSampler.convert(AbstractSampler.java:88)
com.netflix.jmeter.sampler.AbstractSampler.getColumnName(AbstractSampler.java:130)
com.netflix.jmeter.sampler.PutSampler.execute(PutSampler.java:14)
com.netflix.jmeter.sampler.AbstractSampler.sample(AbstractSampler.java:205)
org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:428)
org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
java.lang.Thread.run(Thread.java:679)

  1. Second Case tried the Hard coded value of Date Object and got the error

Cassandra Put Properties --

Column family : sensor3
Row Key : 1
Column Name : Sat, 12 Aug 1995 13:30:00 GMT
Column value : ${__Random(1,1000)}
Column Serializer : DateSerializer
Value Serializer : StringSerializer
Key Serializer : IntegerSerialzer

Attaching Stack trace of problem :

ERROR: java.lang.IllegalArgumentException
java.util.Date.parse(Date.java:615)
com.netflix.jmeter.sampler.AbstractSampler.convert(AbstractSampler.java:88)
com.netflix.jmeter.sampler.AbstractSampler.getColumnName(AbstractSampler.java:130)
com.netflix.jmeter.sampler.PutSampler.execute(PutSampler.java:14)
com.netflix.jmeter.sampler.AbstractSampler.sample(AbstractSampler.java:205)
org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:428)
org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
java.lang.Thread.run(Thread.java:679)

please tell me ,What i'm doing wrong or is there other way to do the same ?

@MattSeese
Copy link

Vishal - have you tried using a Unix time (Epoch time) format instead of the human time stamp :"Sat, 12 Aug 1995 13:30:00 GMT"? That time in milliseconds would be "808234200000"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants