Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[APM] Round up lower bound of time range #84530

Closed
sorenlouv opened this issue Nov 30, 2020 · 1 comment · Fixed by #89030
Closed

[APM] Round up lower bound of time range #84530

sorenlouv opened this issue Nov 30, 2020 · 1 comment · Fixed by #89030
Assignees
Labels
apm:performance APM UI - Performance Work Team:APM All issues that need APM UI Team support v7.12.0

Comments

@sorenlouv
Copy link
Member

sorenlouv commented Nov 30, 2020

To reduce cache misses we should round up the lower bound of the time picker. This is something we could do for APM only, Observability-wide or platform wide. It's probably easiest/quickest to do it just for
APM and then look to expand it.

Example

                        "from": 1605279417058, 3days
                        "to": 1605538617059,

The millisecond precision here will cause all of the dashboards to miss the cache. If, say, they rounded 1605279417058 to 1605279400000 and 1605538617059 to 1605538620000 they are more likely to hit the cache. I've recommended to them in the past that they at least round down the lower range because folks are less sensitive to having a few extra hours or minutes on the low end and the shards on the low end tend to be on slower hardware. They could round up on the upper end but its not as likely to matter because the cache is constantly cleared when there are writes to the shard and the upper end will be getting writes all the time. But rounding up might help long running request for the same dashboard "merge" at the shard request caching layer.

@sorenlouv sorenlouv added [zube]: Inbox Team:APM All issues that need APM UI Team support labels Nov 30, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:apm)

@sorenlouv sorenlouv added [zube]: 7.12 apm:performance APM UI - Performance Work and removed [zube]: Backlog labels Dec 18, 2020
@smith smith self-assigned this Jan 19, 2021
smith added a commit to smith/kibana that referenced this issue Jan 21, 2021
When getting the start and end times, use the d3 time scale `ticks` function to round the start and end times.

Example from a query:

Before:

```json
{
          "range": {
            "@timestamp": {
              "gte": 1611262874814,
              "lte": 1611263774814,
              "format": "epoch_millis"
            }
          }
        },
```

After:

```json
{
          "range": {
            "@timestamp": {
              "gte": 1611263040000,
              "lte": 1611263880000,
              "format": "epoch_millis"
            }
          }
        },
```

The `ticks` function makes it so the amount of rounding is proportional to the size of the time range, so shorter time ranges will be rounded less.

Also fix a bug where invalid ranges in the query string were not handled correctly.

Fixes elastic#84530.
smith added a commit to smith/kibana that referenced this issue Jan 21, 2021
When getting the start and end times, use the d3 time scale `ticks` function to round the start and end times.

Example from a query:

Before:

```json
{
          "range": {
            "@timestamp": {
              "gte": 1611262874814,
              "lte": 1611263774814,
              "format": "epoch_millis"
            }
          }
        },
```

After:

```json
{
          "range": {
            "@timestamp": {
              "gte": 1611263040000,
              "lte": 1611263880000,
              "format": "epoch_millis"
            }
          }
        },
```

The `ticks` function makes it so the amount of rounding is proportional to the size of the time range, so shorter time ranges will be rounded less.

Also fix a bug where invalid ranges in the query string were not handled correctly.

Fixes elastic#84530.
smith added a commit that referenced this issue Feb 2, 2021
When getting the start and end times, use the d3 time scale `ticks` function to round the start and end times.

Example from a query:

Before:

```json
{
          "range": {
            "@timestamp": {
              "gte": 1611262874814,
              "lte": 1611263774814,
              "format": "epoch_millis"
            }
          }
        },
```

After:

```json
{
          "range": {
            "@timestamp": {
              "gte": 1611263040000,
              "lte": 1611263880000,
              "format": "epoch_millis"
            }
          }
        },
```

The `ticks` function makes it so the amount of rounding is proportional to the size of the time range, so shorter time ranges will be rounded less.

Also fix a bug where invalid ranges in the query string were not handled correctly.

Fixes #84530.
smith added a commit to smith/kibana that referenced this issue Feb 2, 2021
When getting the start and end times, use the d3 time scale `ticks` function to round the start and end times.

Example from a query:

Before:

```json
{
          "range": {
            "@timestamp": {
              "gte": 1611262874814,
              "lte": 1611263774814,
              "format": "epoch_millis"
            }
          }
        },
```

After:

```json
{
          "range": {
            "@timestamp": {
              "gte": 1611263040000,
              "lte": 1611263880000,
              "format": "epoch_millis"
            }
          }
        },
```

The `ticks` function makes it so the amount of rounding is proportional to the size of the time range, so shorter time ranges will be rounded less.

Also fix a bug where invalid ranges in the query string were not handled correctly.

Fixes elastic#84530.
smith added a commit that referenced this issue Feb 2, 2021
When getting the start and end times, use the d3 time scale `ticks` function to round the start and end times.

Example from a query:

Before:

```json
{
          "range": {
            "@timestamp": {
              "gte": 1611262874814,
              "lte": 1611263774814,
              "format": "epoch_millis"
            }
          }
        },
```

After:

```json
{
          "range": {
            "@timestamp": {
              "gte": 1611263040000,
              "lte": 1611263880000,
              "format": "epoch_millis"
            }
          }
        },
```

The `ticks` function makes it so the amount of rounding is proportional to the size of the time range, so shorter time ranges will be rounded less.

Also fix a bug where invalid ranges in the query string were not handled correctly.

Fixes #84530.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:performance APM UI - Performance Work Team:APM All issues that need APM UI Team support v7.12.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants