Search code examples
javajmetertime-seriesinfluxdbbeanshell

Missing of data while pushing multiple data simultaneously to influxdb.?


I am pushing data to influxdb simultaneously using JMeter with the help of some code. The data are pushed to the database but if the code has to push 100 data, the influx database is only filled with 96 or 97 entries. where as the built-in influx listener pushes 100 entries, My code fails to push all hundred entries to influx. My code snippet is below.

InfluxDB influxDB = InfluxDBFactory.connect(“http:/l/ocalhost:8086”,“TestingDB,”");
influxDB.createDatabase(“MYTestData”);

Point point1 = Point.measurement(“myTable”)
.time(System.currentTimeMillis() , TimeUnit.MILLISECONDS)
.tag(“CustomerID”,"ID1234 ")
.tag(“empID”,"emp1234 ")
.tag(“TestID”,“test12343”)

influxDB.write(“DBname”, “autogen”, point1);

If I run this same code with 10 users with 10 iteration I need to get 100 data points where in am getting only 95 or more entries. Why is that the inbuild listener can push 100% data and I am not.???


Solution

  • This might be due to Beanshell which has known performance problems when it comes to high loads.

    If you want to use JMeter scripting functionality make sure to use JSR223 Test Elements and Groovy language.

    A better choice would be using implementing your custom Listener - check out How to write a plugin for JMeter.