Hi Folks,
For context I am running InfluxDB v2.7.11 on a Raspberry Pi 5 (SSD)
Node red is pushing between 5 and 10 values / s, depending on what is going on with my monitored system, all of which are using the default timestamp as opposed to node red sending on in.
In that respect all seems fine and I am able to query data, I was going to say easily, but Flux was a bit of a shock to someone who was anticipating SQL, and hasn’t used that for years either.
The point is its working and I have templated text in Node red building Flux queries, all be it simple ones, which feed dynamic graphs…
I doubt they are optimal, but they work soi far as I can tell.
SO… Having grasped the very basics of Flux I now need to start down-sampling before the entire thing grinds to a halt!
My plan, well seed of an idea at this point, is to have several buckets, with increasingly long retention and correspondingly long aggregate periods.
Which as far as I understand is a fairly standard approach.
After much thought, and with the exception of a couple of status events that need to be counted, I have decided that holding only mean, min and max values for almost all my data will be fine.
That leaves me wondering how best to do that?
So far as I can tell, there are two options, both of which has two approaches, but I may be completely wrong about all of them, hence this question.
1a.
Down-sample each field to some aggregate period, keeping the fieldname and adding a tag.
Do this 3 times, once for each aggregate function, tagged min/mean/max, and end up with 3 rows for every field at every timestamp. (Is that a series?)
1b.
As 1a, but change the fieldname and don’t add any tags.
2a.
Run 1a, and pivot the result into a table with multiple columns, min / mean / max and tag the row with the original fieldname.
2b.
Run 1b, and pivot the result into a table with multiple columns, derived from the new fieldnames.
My gut is telling me multiple rows is bad when a single row with multiple columns is a possibility but I am assuming I am missing something fundamental here as multiple rows seems to be the preferred schema…
I would very much appreciate your thoughts and guidance, and will likely have questions about actual code structure once I have a well formed goal in sight!
I have managed to get useful queries working, have played with a couple of math functions, map pivot and of course range and filter, but to say I had a handle in it would be overstating at this point. What I am looking for is to understand why I am going to do whatever is recommended, with the why being as important as the how… So I actually learn something as opposed to just using a code snippet I don’t understand for a reason I understand even less!
Any and all help will be very much appreciated.
Happy to post code but didn’t think it would help yet!
Thanks in advance…
Al