Anyone know of an elegant solution to find nearest data-point to a timestamp?

25 views
Skip to first unread message

Jonathan Rogers

unread,
Nov 16, 2017, 9:21:49 AM11/16/17
to OpenTSDB
Hi all,

I have some time series data that can be visualized over time as well as at a single timestamp. I am looking for an elegant solution to find a data point nearest to a timestamp without relying on multiple calls. 

background:
Data is numerous and relies on downsampling to be compact enough to send to a front-end web app.
Users will have the ability to view a single timestamp by clicking on the trend of downsampled data.
I need to find an elegant, preferably fast, solution to using the downsampled timestamps to return the nearest data point.

My only thought right now is to do the following:
1) Request a very small amount of data (single dps array) for the metric to see available times --> I would use selected downsampled time +- downsample rate
2) Make the full request after determining the nearest timestamp from (1)

This, however, relies on two distinct calls to the opentsdb api, which over the web can result in significant loading times I would prefer to avoid.

Is there the possibility of creating our own end points, example: /api/nearest/, via Java to create such a work-around?

Thanks for your help.

ManOLamancha

unread,
Jan 30, 2018, 1:54:07 PM1/30/18
to OpenTSDB
Hmm, we don't have anything like that now but we could add it to 3.x if you want to open a feature request on Github please. 
Reply all
Reply to author
Forward
0 new messages