influxdata / influxdata/influxdb

timeShift() function not adding accurate time to _start and _stop

Open
#21,503 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

Hi
I was trying out the timeShift() function and according to the documentation the duration is "The amount of time to add to each time value" this seems to be the case for the _time column but for _start and _stop it does not seems to add the correct amount of time. I made the following time shift queries on my data:

timeShift(duration: 0s, columns: ["_start", "_stop", "_time"])
timeShift(duration: 1s, columns: ["_start", "_stop", "_time"])

In the table below the first row is 0 s time shift and the second row is 1 s time shift. As you can see it is correct for _time but for _start and _stop it looks like it adds something like 32 seconds

_start                      _stop                       _time
2021-04-19T07:54:11.063Z    2021-05-19T07:54:11.063Z    2021-05-11T13:02:14.808Z
2021-04-19T07:54:43.842Z    2021-05-19T07:54:43.842Z    2021-05-11T13:02:15.808Z

I hope I have not misinterpreted something.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two timeShift() queries from the report with the same _start, _stop, and _time columns. Trace how duration is applied to each column and verify that a 1s shift changes all three timestamps by exactly one second.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.