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

TSVB should use "histogram:maxBars" and "histogram:barTarget" settings for auto instead of a default 100 buckets #83628

Merged
merged 13 commits into from
Nov 24, 2020

Conversation

alexwizp
Copy link
Contributor

@alexwizp alexwizp commented Nov 18, 2020

Closes: #54012

Summary

This PR adds an additional Level of detail option for TSVB on the Time Series tab

Screen Recording 2020-11-23 at 3 15 00 PM

The mechanism for obtaining the maximum value of buckets has also been changed. Instead of a hard-coded value of 100 buckets, now we take this value from the uiSettings by reading:

  • histogram:maxBars - max value for Max Bars input control
  • histogram:barTarget - default values for Max Bars input control

src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/calculate_auto.js was removed. We reused the same code from data plugin

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@alexwizp
Copy link
Contributor Author

@elasticmachine merge upstream

1 similar comment
@alexwizp
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@wylieconlon wylieconlon left a comment

Choose a reason for hiding this comment

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

In this first round of comments I'm mostly commenting on the behavior. Here's what I noticed:

  1. I think it would be save to increase the histogram limit well past 100 by default. Why not set it as high as 65k, which is the limit in ES for now?

  2. Similar to the issues we saw with auto histograms for numbers, it's confusing that the slider doesn't actually change anything automatically. What we decided for Lens was that an unlabeled slider with 5 "steps" is a pretty good way of doing this

  3. I'd like to tweak the form design even more, maybe we can use the idea of the "granularity" slider that Lens has?


return calculateAuto.near(100, duration).asSeconds();
return calcAutoIntervalLessThan(maxBars, timerange).asSeconds();
Copy link
Contributor

Choose a reason for hiding this comment

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

Okay so if I understand correctly this is the core part of the change, previously auto was hardcoded to 100, and now it's up to 100?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes that true. Now we read histogram:maxBars configuration property as a limit value. The user can change it if necessary.

@alexwizp
Copy link
Contributor Author

alexwizp commented Nov 20, 2020

@timroes @wylieconlon Today I tried various options for making this functionality obvious to users. What do you think about next option:

image

regardless of the histogram:maxBars value in the configuration, we will work with a percentage representation. In this case, a step of 10% of the histogram:maxBars value looks like a good solution from the UI perspective.

@timroes
Copy link
Contributor

timroes commented Nov 23, 2020

@alexwizp I like linking this up to the existing advanced settings. I also support Wylie's ask here for control of the level of detail. On the specific UI: I guess I'd not put a percentage on this slider, since it might cause confusion again: "What does 100% mean?" "So 50% will always be half of the 100%?" (which due to rounding it might not afaik).

I guess I would just label the two sides of the slider "Coarse" and "Finest" and don't give the actual values within a label in the UI.

@alexwizp
Copy link
Contributor Author

Thank you @timroes and @wylieconlon. PR was updated
Screen Recording 2020-11-23 at 3 15 00 PM

@alexwizp alexwizp changed the title TSVB needs a "tsvb:max_buckets" target setting for auto instead of a default 120 buckets TSVB should use "histogram:maxBars" and "histogram:barTarget" settings for auto instead of a default 100 buckets Nov 23, 2020
@alexwizp alexwizp marked this pull request as ready for review November 23, 2020 13:07
@alexwizp alexwizp requested a review from a team November 23, 2020 13:07
@alexwizp alexwizp requested a review from a team as a code owner November 23, 2020 13:07
@alexwizp alexwizp self-assigned this Nov 23, 2020
@alexwizp alexwizp added release_note:enhancement Feature:TSVB TSVB (Time Series Visual Builder) Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Nov 23, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@alexwizp
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@wylieconlon wylieconlon left a comment

Choose a reason for hiding this comment

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

I'm really liking the direction of this improvement! I've left a few more comments about the behavior and labeling, but I think I don't need to do another code review to approve the direction.

Before merging, please make sure the title and description are appropriate to be put directly into the release notes: https://www.elastic.co/guide/en/kibana/7.10/release-notes-7.10.0.html

This includes the checklist!

isEntireTimeRangeActive(model, isTimeSeries) ||
!(model[intervalName] === AUTO_INTERVAL || !model[intervalName])
}
min={0}
Copy link
Contributor

Choose a reason for hiding this comment

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

This value is definitely wrong because it will never generate data. I think a value of 1 is probably too low as well. What do you think about 10?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wylieconlon I needed it earlier to correctly mark the scale from 0 to 100 with a step of 10. When entering a number other than 0, the scale would be shifted. I handle that case here:
image
Let's create a constant to make it a little obvious

Unfortunately even without a scale I cannot set1as a min value cause the max - min value must be a multiple of the step property, otherwise I see an error. Looks like a problem with EUI component.
image

Also I'm not sure that 10 is a good default value for this property. I think for some cases 1 value can be useful and allows to emulate "Entire timerange mode" which we have on other tabs in TSVB. Please keep in mind that to see data for that case you should set
image

# Conflicts:
#	src/plugins/data/server/server.api.md
Copy link
Member

@lukeelmers lukeelmers left a comment

Choose a reason for hiding this comment

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

Updates to aggs service LGTM, thanks @alexwizp! Code review only

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
visTypeTimeseries 1.8MB 1.8MB +3.6KB

Distributable file count

id before after diff
default 43051 43050 -1
oss 22583 22582 -1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
data 976.0KB 977.4KB +1.4KB
visTypeTimeseries 137.1KB 137.8KB +698.0B
total +2.0KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@alexwizp alexwizp merged commit 6ef6c0f into elastic:master Nov 24, 2020
alexwizp added a commit to alexwizp/kibana that referenced this pull request Nov 24, 2020
…s for auto instead of a default 100 buckets (elastic#83628)

* TSVB needs a "tsvb:max_buckets" target setting for auto instead of a default 120 buckets

Closes: elastic#54012

* remove calculate_auto

* max bars -> Level of detail

* rename allowLevelofDetail

* fix PR comment

* Update constants.ts

* Update src/plugins/vis_type_timeseries/public/application/components/index_pattern.js

Co-authored-by: Wylie Conlon <[email protected]>

* create LEVEL_OF_DETAIL_MIN_BUCKETS constant

* calcAutoIntervalLessThan -> search.aggs.calcAutoIntervalLessThan

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Wylie Conlon <[email protected]>
# Conflicts:
#	src/plugins/data/server/server.api.md
Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

LGTM, didnt test it locally

rylnd added a commit to rylnd/kibana that referenced this pull request Nov 24, 2020
* master: (41 commits)
  [Maps] fix code-owners (elastic#84265)
  [@kbn/utils] Clean target before build (elastic#84253)
  [code coverage] collect for oss integration tests (elastic#83907)
  [APM] Use `asTransactionRate` consistently everywhere (elastic#84213)
  Attempt to fix incremental build error (elastic#84152)
  Unskip "Copy dashboards to space" (elastic#84115)
  Remove expressions.legacy from README (elastic#79681)
  Expression: Add render mode and use it for canvas interactivity (elastic#83559)
  [deb/rpm] Move systemd service to /usr/lib/systemd/system (elastic#83571)
  [Security Solution][Resolver] Allow a configurable entity_id field (elastic#81679)
  [ML] Space permision checks for job deletion (elastic#83871)
  [build] Provide ARM build of RE2 (elastic#84163)
  TSVB should use "histogram:maxBars" and "histogram:barTarget" settings for auto instead of a default 100 buckets (elastic#83628)
  [Workplace Search] Initial rendering of Org Sources (elastic#84164)
  update geckodriver to 0.28 (elastic#84085)
  Fix timelion vis escapes single quotes (elastic#84196)
  [Security Solution] Fix incorrect time for dns histogram (elastic#83532)
  [DX] Bump TS version to v4.1 (elastic#83397)
  [Security Solution] Add endpoint policy revision number (elastic#83982)
  [Fleet] Integration Policies List view (elastic#83634)
  ...
alexwizp added a commit that referenced this pull request Nov 25, 2020
…s for auto instead of a default 100 buckets (#83628) (#84250)

* TSVB needs a "tsvb:max_buckets" target setting for auto instead of a default 120 buckets

Closes: #54012

* remove calculate_auto

* max bars -> Level of detail

* rename allowLevelofDetail

* fix PR comment

* Update constants.ts

* Update src/plugins/vis_type_timeseries/public/application/components/index_pattern.js

Co-authored-by: Wylie Conlon <[email protected]>

* create LEVEL_OF_DETAIL_MIN_BUCKETS constant

* calcAutoIntervalLessThan -> search.aggs.calcAutoIntervalLessThan

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Wylie Conlon <[email protected]>
# Conflicts:
#	src/plugins/data/server/server.api.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:TSVB TSVB (Time Series Visual Builder) release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TSVB needs a "tsvb:max_buckets" target setting for auto instead of a default 120 buckets
7 participants