ERR: aggregate function required inside the call to elapsed


Hello everyone,

I recenlty started influxdb with jmeter but I stuck with this error for a while now ERR: aggregate function required inside the call to elapsed.

I have browsed some post here and there but havent found any usefull information so far. That’s why I’m requesting the help of this forum.

In a nutshell I have created a plugin in jmeter. This plugin is sending something and receiving an ack. Jmeter is logging in influxdb all these operations.

I end up with a table of operations. On each line of the table I have the timestamp, the operation type and the operation ID. For each operation ID I have 2 line, the receive and the ack.

What I want to do now is to get the average elapsed time for the total operation (time diff between send and ack) per second.

The query I started to write is the following:

select mean(elapsed_time) from (select elapsed(op_type,1ms) as elapsed_time from operations group by op_correl_id) where time >= 1527522277003ms and time <= 1527522370305ms group by time(1s)

But I get the error above.

The subquery is working fine. I get the elapsed time for each operation. Getting the average of it (mean) works as well. But when I try to group by 1s it fail. But that’s the all point. I don’t want to get the global mean. I want to follow the evolution of this mean over time when I’m actually sending traffic via jmeter.

Let me know if you need any extra information.

Thanks in advance for your help,



Any idea ? Or just leads where I could fin my answer ? :grinning:



I’m a user of InfluxDb (1.6.2) and I have exactly the same problem when trying to aggregate the result of a subquery with grouping by time.

My query is :

select sum(*) from (select elapsed(*) from "test_influx"."1h"."TEST_SYNTH_VALUESTR") group by time(10m)

And it result in the same error message : aggregate function required inside the call to elapsed.

The subquery alone works and the sum of the subquery without grouping by time works as well.

I tried other aggregation functions (count, min, max) but the result is the same, I don’t think it is the expected behaviour but maybe I’m doing it the wrong way !

I really appreciate any information about this thread.


I’m facing the same issue here,
do we have more people with this issue?
And seems something related to the elapsed + group by time()
If you change your group by “any_other_column”, probably, just like me you will have your query working (with wrong data obviously… )