grafana/xk6-output-influxdb

Number of measurements in InfluxDB is less then in result.json

ziganow opened this issue · 5 comments

Hi,
I'am wondering why the number of record during the testrun differ from the report summary of k6 itself and also differ from json result output. There are always less records in InfluxDB.
My Last run:
K6 excerpt
http_reqs......................: 29500 132.648204/s

JQ Query:
jq '. | select(.type=="Point" and .metric == "http_reqs" and .data.tags.testrun == "20240422145315" ) | .data.value' script_results.json | jq -s "length"
29500

Influx Flux Query:
from(bucket: "k6")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "http_reqs")
|> filter(fn: (r) => r["_field"] == "value")
|> filter(fn: (r) => r["testrun"] == "20240422145315")
|> group()
|> count()
|> yield(name: "mean")

29268 ---> missing 232 records

Any idea what is going wrong here?

Kind Regards
Alexey

Thanks for reporting this and the inclusion of the queries. 🙇

Did you have the following line in the The flush operation took higher than the expected set push interval. Or any other warning during the test run ?

Also have you tried with bigger time range in influxdb as it might turn out you just "cropped" the last few requests?

Hello! I encountered the same issue, and wrote about it in the Grafana Community. The reason in my case was the difference in time precision between Go and Windows, as I was running the tests on Windows. How do you run your tests?

If you are correct than this is the same problem as @marijamitevska-rldatix - your timestamp for a given sample matches exactly another one(among the others).

AFAIK the only solution for this will be to aggregate samples, and AFAIK this is not planned to be worked on for this extension.

Also AFAIK it won't be backwards compatible so it likely will need to either bump a major version or be a separate project.

cc @codebien