Well, what do we want to test for. Actually, TSBS does not contain type of queries that are using in our use case, so we are doing just a general assessment. We want to have same dataset on same hardware and see which one (Influx of Timescale) performs better. So the type of queries does not matter much (for us right now). But we wanted to have dataset similar to our use case. That means, different log intervals for different time ranges.
As for InfluxV2, I have pushed my branch just few hours ago: GitHub - rusnackor/tsbs at influx_v2_extension
(there is alot of hardcoded and debug stuff, definetly not final version)
So far, I have added authentication with Token and Organization ID. That is working.
But I wasn’t able to move query from path to body of the request. As API V2.2 is suggesting
That’s why I was trying to use InfluxQL
for query sending, instead of Flux
.
Yesterday I spent all day debugging it, and I got from:
~/go/bin # ./tsbs_run_queries_influx --workers=8 --db-name="sandboxDB" --print-responses --file=/share/q_ex/influx-q_1_last-loc
{
ID 0: "influxql": "SELECT \"latitude\", \"longitude\" \n\t\tFROM \"readings\" \n\t\tWHERE \"fleet\"='North' \n\t\tGROUP BY \"name\",\"driver\" \n\t\tORDER BY \"time\" \n\t\tLIMIT 1",
ID 0: "response": {
ID 0: "results": [
ID 0: {
ID 0: "error": "database not found: sandboxDB",
ID 0: "statement_id": 0
ID 0: }
ID 0: ]
ID 0: }
ID 0: }
through:
Body: {"code":"invalid","message":"failed to decode request body: failed parsing request body as JSON; if sending a raw Flux script, set 'Content-Type: application/vnd.flux' in your request headers: EOF"}
Error: <nil>
panic: http request did not return status 200 OK - R
Body: {"code":"invalid","message":"failed to decode request body: request body requires either query or AST"}
Error: <nil>
panic: http request did not return status 200 OK - R
to where I am actually:
~/go/bin # ./tsbs_run_queries_influx --workers=8 --token="MyTokenMyToken==" --organization="Idk" --db-name="benchmarkdb" --print-responses --file=/share/q_ex/influx-q_1_last-loc
2022/04/22 10:25:54 daemon URLs: [http://localhost:8086]
----- ====== HQ:
HumanLabel: "Influx last location per truck", HumanDescription: "Influx last location per truck", Method: "POST", Path: "/query?q=SELECT+%22latitude%22%2C+%22longitude%22+%0A%09%09FROM+%22readings%22+%0A%09%09WHERE+%22fleet%22%3D%27North%27+%0A%09%09GROUP+BY+%22name%22%2C%22driver%22+%0A%09%09ORDER+BY+%22time%22+%0A%09%09LIMIT+1", Body: ""
----- ===== URI:
http://localhost:8086/query?q=SELECT+%22latitude%22%2C+%22longitude%22+%0A%09%09FROM+%22readings%22+%0A%09%09WHERE+%22fleet%22%3D%27North%27+%0A%09%09GROUP+BY+%22name%22%2C%22driver%22+%0A%09%09ORDER+BY+%22time%22+%0A%09%09LIMIT+1&database=benchmarkdb&orgID=Idk
{
ID 0: "influxql": "SELECT \"latitude\", \"longitude\" \n\t\tFROM \"readings\" \n\t\tWHERE \"fleet\"='North' \n\t\tGROUP BY \"name\",\"driver\" \n\t\tORDER BY \"time\" \n\t\tLIMIT 1",
ID 0: "response": null
ID 0: }
Run complete after 1 queries with 8 workers (Overall query rate 189.51 queries/sec):
Influx last location per truck:
min: 1.97ms, med: 1.97ms, mean: 1.97ms, max: 1.97ms, stddev: 0.00ms, sum: 0.0sec, count: 1
all queries :
min: 1.97ms, med: 1.97ms, mean: 1.97ms, max: 1.97ms, stddev: 0.00ms, sum: 0.0sec, count: 1
wall clock time: 0.008019sec
~/go/bin #
And now, I am deciding between 2 options:
1.) Debug why InfluxQL
is returning no response (even if I run the URL with curl
). But I am not sure if it is even possible, if InfluxV2.2 still support this.
2.) Move to Flux
syntax, but that requires to rewrite query generation and rewrite all the queries from SQL syntax to the flux
language. But that is a deep well of queries generation that I am not sure if I wont drown in also rewriting all the queries from SQL to flux
is not a small task.
However, I still think, I am really close to make it work, and hopefully with a little bit of support, I can finish it. Maybe not make it user friendly as the original script is, but working at least with some hardcoded stuff and than, making it user friend, shouldn’t be too hard for you guys.