how to get 'EXACT' downsampled result?

27 views
Skip to first unread message

imaor

unread,
Aug 29, 2016, 10:27:54 AM8/29/16
to OpenTSDB
version : 2.2.0

I want to get each total count from 2016-08-22 00:00:00 to 2016-08-24 00:00:00 for every 24 hours.
so the query was like:
http://localhost:4242/api/query?start=1471795200&end=1471968000&m=zimsum:24h-zimsum-zero:key_f0f577c0b97d416

The expected result should be two points as below:
2016-08-23 00:00:00  {the count from 2016-08-22 00:00:00 to 2016-08-23 00:00:00}
2016-08-24 00:00:00  {the count from 2016-08-23 00:00:00 to 2016-08-24 00:00:00}

but I got two points with the timestamp: 
2016-08-22 08:00:00 {what's the count meaning?}
2016-08-23 08:00:00 {what's the count meaning?}

How can I get the exact total count every 24 hours (from every 00:00:00 to the next 00:00:00)
I'm sure that every minute has at least one point in the DB.

ManOLamancha

unread,
Dec 19, 2016, 8:38:03 PM12/19/16
to OpenTSDB
You're running into a timezone issue. Everything stored in TSDB is written in UTC timestamps (As you saw in your query). But pulling it back out is also UTC unfortunately. For downsampling, we added calendar based code to 2.3 that will let you do what you want. I haven't documented it yet but you should be able to pass in a timezone and specify a flag to force it to align to days based on your zone. I'll try and get those docs up this weekend and definitely before the final release. 
Reply all
Reply to author
Forward
0 new messages