Open ZhongChaoqiang opened 6 years ago
When TsdbQuery#setStartTime() is called by CliQuery#parseCommandLineQuery and GraphHandler#doGraph, the start time has been converted to seconds, but TsdbQuery#configureFromQuery don't. Should TsdbQuery#configureFromQuery convert start time to seconds before calling TsdbQuery#setStartTime()?
Yes this is a bug in TSDB that we'll address in 3.0 with timestamps. Unless someone wants to patch 2.x to handle this edge case.
Insert a data point with timestamp 100001: curl -i -X POST -d '{"metric":"test1", "timestamp":100001, "value":2, "tags":{"tagk1":"tagv1"}}' http://X.X.X.X:4242/api/put?sync&sync_timeout=1000
And we query with timestamp range of 100000 to 100005. The result is empty. curl -i -X POST -d '{"start": 100000,"end": 100005,"queries": [{"aggregator": "none","metric": "test1"}]}' http://X.X.X.X:4242/api/query
The root cause mybe as bellow: In TsdbQuery#getScanStartTimeSeconds() function, the start Time that returned by getStartTime() must be milliseconds, so we don't need to check whether start Time is seconds or milliseconds.
Can Anyone check this issue and fix it ?