我在一些代码的帮助下使用 JMeter 同时将数据推送到 influxdb。数据被推送到数据库,但如果代码必须推送 100 条数据,则 influx 数据库仅填充 96 或 97 个条目。当内置 influx 监听器推送 100 个条目时,我的代码无法将所有 100 个条目推送到 influx。我的代码片段如下。
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);
如果我对 10 个用户运行相同的代码并进行 10 次迭代,我需要获取 100 个数据点,而我只获取 95 个或更多条目。 为什么内置监听器可以推送 100% 数据,而我却不能。???
最佳答案
这可能是由于 Beanshell 在高负载时存在已知的性能问题。
如果您想使用 JMeter 脚本功能,请确保使用 JSR223 Test Elements和 Groovy语言。
更好的选择是使用实现您的自定义 Listener - 查看How to write a plugin for JMeter 。
关于java - 同时将多个数据推送到 influxdb 时丢失数据。?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50940475/