Is there any Java API in OpenTSDB to perform the following tasks :
- Batch insert multiple metrics (with multiple datapoints for each metric).
- Bulk import from a file.
I get the data in a CSV file as follows :
timestamp,tag,metric1,metric2,metric3,metric4,metric5
1315000846,Test_01,62.5,82.5,52.5,10.5,85.5
1315000850,Test_02,52.5,72.5,42.5,5.5,75.5
The time-series data for the above two lines will be as follows :
metric1 1315000846 62.5 tag=Test_01
metric2 1315000846 82.5 tag=Test_01
metric3 1315000846 52.5 tag=Test_01
metric4 1315000846 10.5 tag=Test_01
metric5 1315000846 85.5 tag=Test_01
metric1 1315000850 52.5 tag=Test_02
metric2 1315000850 72.5 tag=Test_02
metric3 1315000850 42.5 tag=Test_02
metric4 1315000850 5.5 tag=Test_02
metric5 1315000850 75.5 tag=Test_02
I am thinking of two ways :
- Batch insert the above datapoints using some api (if available)
- Save the above content in a new file and bulk upload this file using some api (if available)
I have gone through WritableDataPoints, using which we can add multiple datapoints.
But I am not sure if we can add multiple metrics using the same instance (setSeries() takes only a single metric name).