ytyou / ticktock

TickTockDB is an OpenTSDB-like time series database, with much better performance.
GNU General Public License v3.0
76 stars 9 forks source link

tsdb.timestamp.resolution #24

Closed mkohns closed 1 year ago

mkohns commented 1 year ago

HI!

Great Job here! I like it. One question:

[{"metric":"boiler_data_ww.wwcurtemp","tags":{"host":"BUDERUS"},"aggregateTags":[],"dps":{"1666436125":52.7999999999999972,"1666436135":52.7000000000000028,"1666436145":52.7000000000000028,"1666436155":52.7999999999999972,"1666436165":52.7999999999999972,"1666436175":52.7999999999999972,"1666436185":52.7999999999999972,"1666436195":52.7999999999999972,"1666436205":52.7999999999999972,"1666436215":52.7999999999999972,"1666436225":52.7999999999999972}}]%

What am I doing wrong. My expectation was, that ticktock also saves them in millis, and not only accepting them and rounding.

ytyou commented 1 year ago

When query, you need to specifiy msResolution=true (as described in http://opentsdb.net/docs/build/html/api_http/query/index.html). If you've already done that, then it's a bug. Please let us know. Thanks.

mkohns commented 1 year ago

Great! I will Test and give Feedback! Thanks for the fast response!

ylin30 commented 1 year ago

@mkohns here is an example:

Without msResolution=true:

[Yi-MBP ticktock (dev2)]$ curl -s 'http://192.168.1.15:6182/api/query?m=avg:ticktock.mem.reusable.total:&start=1666458310&end=1666458312'
[{"metric":"ticktock.mem.reusable.total","tags":{},"aggregateTags":["type"],"dps":{"1666458311":7171.6756756756758477}}]

With msResolution=true:

[Yi-MBP ticktock (dev2)]$ curl -s 'http://192.168.1.15:6182/api/query?m=avg:ticktock.mem.reusable.total:&start=1666458310&end=1666458312&msResolution=true'
[{"metric":"ticktock.mem.reusable.total","tags":{},"aggregateTags":["type"],"dps":{"1666458311425":7171.6756756756758477}}]