Skip to content

Supporting from and to properties in relative time ranges.#9899

Merged
kmerz merged 4 commits intomasterfrom
from-and-to-support-in-relative-ranges
Jan 15, 2021
Merged

Supporting from and to properties in relative time ranges.#9899
kmerz merged 4 commits intomasterfrom
from-and-to-support-in-relative-ranges

Conversation

@dennisoelkers
Copy link
Copy Markdown
Member

@dennisoelkers dennisoelkers commented Jan 13, 2021

Description

Motivation and Context

This change is implementing functionality to support an alternative way to use relative time ranges. Instead of a range property that defines the length of the range in seconds going backwards from now, it allows defining from and to properties defining the endpoints of a range in relation to now. This allows e.g. defining a range that goes from 5 minutes ago to 1 minute ago by specifying a relative range as:

{
  "type": "relative",
  "from": 300,
  "to": 60
}

Fixes #9898.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

This change is implementing functionality to support an alternative way
to use relative time ranges. Instead of a `range` property that defines
the length of the range in seconds going backwards from now, it allows
defining `from` and `to` properties defining the endpoints of a range in
relation to `now`. This allows e.g. defining a range that goes from 5
minutes ago to 1 minute ago by specifying a relative range as:

```
{
  "type": "relative",
  "from": 300,
  "to": 60
}
```

Fixes #9898.
Copy link
Copy Markdown
Member

@kmerz kmerz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM!
Worked on my machine.

@kmerz kmerz merged commit 20d08f7 into master Jan 15, 2021
@kmerz kmerz deleted the from-and-to-support-in-relative-ranges branch January 15, 2021 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for relative time range from and to attributes.

2 participants