influxdb-java icon indicating copy to clipboard operation
influxdb-java copied to clipboard

Support dynamic measurement name in InfluxDBResultMapper

Open dparmar opened this issue 9 years ago • 4 comments

In my case the measurement name is not known at compile time. So I was wondering if toPOJO() can take it as a parameter.

As a quick fix, currently I extend InfluxDBResultMapper and override getMeasurementName, but that doesn't look like elegant solution.

Thanks for this very useful feature.

dparmar avatar Aug 30 '17 18:08 dparmar

@dparmar we could add a new parameter to toPOJO method where you could pass a measurement name. But before we do it, I'm curious: how do you name your measurements? Are you naming them using a pattern like <measurement>_yyyymmdd (e.g. cpu_20170901)?

fmachado avatar Sep 08 '17 19:09 fmachado

They are user defined names like test_1, test_2

dparmar avatar Sep 08 '17 21:09 dparmar

Why don't you use then a database or tag for it? We for example have a database for each user - so we can clearly separate the data and access to it. But the measurements are the same - just the tag values are different. I am curious about your use-case and approach.

martinschuberts avatar Sep 09 '17 09:09 martinschuberts

We have also the same problem. The solution suggested about adding a new parameter to toPojo would be great.

We do not follow any specific pattern to name the measurements; sometimes it is name_subname or name.subname, etc..

Do you need more info, because this feature would be very interesting for us.

Thanks in advance

ikercrg avatar Feb 28 '18 16:02 ikercrg