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

Timefilter Auto Refresh - Closes "Support for auto-refresh #1845" #2196

Merged
merged 95 commits into from
Dec 30, 2014
Merged

Timefilter Auto Refresh - Closes "Support for auto-refresh #1845" #2196

merged 95 commits into from
Dec 30, 2014

Conversation

grouma
Copy link
Contributor

@grouma grouma commented Dec 9, 2014

Fixes #1845 - Support for auto-refresh
Fixes #1778 - Courier race condition
Fixes #2365 - Respect shard_timeout config
Fixes #2420 - Visualization disappears in discover

Feature:
Enable auto-refresh of the various built in tabs, e.g. Discover, Visualize and Dashboard. The implementation should allow future plugins to respond to refresh events.

Usage:
Upon clicking the top right corner, you will be presented with two tabs, "Time Filter" and "Refresh Interval" (see attached image for details). The "Time Filter" tab allows users to add time filters in the same capacity as they are today. The new "Refresh Interval" tab allows users to select a predefined refresh interval. Upon selecting a refresh interval, all tabs will automatically refresh their content.

Implementation:
The feature was implemented by piggy-backing on top of the existing timefilter object. The timefilter object now contains a refreshInterval. The courier now receives reference to the timefilter object and listens for changes on this refreshInterval. It updates the search interval accordingly.

refreshfeature

  • merge master
  • search requests that don't complete before the refresh interval is triggered again should delay the next trigger until they are complete. (pretty sure this will require some dev)
  • verify that requests/searchSources are never duplicated
  • choosing "auto refresh off" should not trigger another request
  • refresh interval should be saved in sessionStorage so that it persists across refreshes, but is issolated from other tabs and won't be shared in urls
  • Give love to list of refresh options.

@rashidkpc
Copy link
Contributor

The applications shouldn't need individual refresh handlers, rather the courier should just reget the data and the applications should react to it.

Also, this has windows build system changes merged into that are outside the scope of the issue.

@grouma
Copy link
Contributor Author

grouma commented Dec 9, 2014

I agree that making use of the courier class will simplify things. Let me make those changes.

@grouma
Copy link
Contributor Author

grouma commented Dec 9, 2014

I have removed the windows build system changes and have updated the implementation to make use of the courier class.

@rashidkpc
Copy link
Contributor

Had a quick look over, can you add tests for this?

@grouma
Copy link
Contributor Author

grouma commented Dec 11, 2014

Tests added.

@@ -18,7 +18,7 @@
<!-- Full navbar -->
<div collapse="!showCollapsed" class="navbar-collapse" id="kibana-primary-navbar">
<ul class="nav navbar-nav">
<li ng-repeat="app in apps.inOrder | filter:{show: true}" ng-class="{active: activeApp === app}">
Copy link
Contributor

Choose a reason for hiding this comment

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

The | filter: {show: true} needs to stay in there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will fix.

@spalger
Copy link
Contributor

spalger commented Dec 12, 2014

@grouma thanks for the PR! I left a couple notes

@grouma
Copy link
Contributor Author

grouma commented Dec 15, 2014

@spenceralger all open issues should be addressed in most recent commit. Let me know if you need any other changes.

@spalger
Copy link
Contributor

spalger commented Dec 15, 2014

@grouma sweet, could you do us a favor and merge master?

@spalger spalger mentioned this pull request Dec 15, 2014
@grouma
Copy link
Contributor Author

grouma commented Dec 15, 2014

Looks like you already took care of it. Thanks.

@w33ble
Copy link
Contributor

w33ble commented Dec 15, 2014

@grouma nice work on this, it's a pretty cool addition!

We've got some comment in @spenceralger's PR #2324. We had hoped we could get this in the next release, but it appears that's happening a little too soon - we might bring the comments back here, especially if you want to keep helping out with it. Just trying to figure out how to proceed.

@grouma
Copy link
Contributor Author

grouma commented Dec 15, 2014

@w33ble Let's bring it back here and I'll address the issues.

@spalger
Copy link
Contributor

spalger commented Dec 15, 2014

@grouma, I was hoping we would be able to get this into beta 3 (which we plan to release tomorrow). After discussing it with the team though, we all agree that has the potential to include bugs we don't really have the time to prove don't exist before then. Since we aren't trying to rush this in anymore, I'm going to close my issue and we will continue development here.

Off the top of my head, these are a few things we need to resolve:

  • merge master
  • search requests that don't complete before the refresh interval is triggered again should delay the next trigger until they are complete. (pretty sure this will require some dev)
  • verify that requests/searchSources are never duplicated
  • choosing "auto refresh off" should not trigger another request

@grouma
Copy link
Contributor Author

grouma commented Dec 16, 2014

@spenceralger I have merged the master and prevented the "off" interval from triggering another request. I am unsure how to address the other two issues since the Discover plugin provides a custom "fetch" function. I would like to leverage the logic already provided in the courier component. Any guidance would be appreciated.

@spalger
Copy link
Contributor

spalger commented Dec 16, 2014

Sweet, if you can work on verifying the courier based requests in visualize and dashboard and I'll work on moving discovers segmented fetch into a courier search strategy. I've been meaning to do that anyway.

@spalger spalger assigned w33ble and unassigned spalger Dec 29, 2014
@w33ble w33ble assigned spalger and unassigned w33ble Dec 29, 2014
@spalger spalger assigned w33ble and simianhacker and unassigned spalger and w33ble Dec 29, 2014
@simianhacker
Copy link
Member

Add issue for throbber and sorting and LGTM

@spalger
Copy link
Contributor

spalger commented Dec 30, 2014

Added issue for sorting, but handled throbber really quick.

spalger pushed a commit that referenced this pull request Dec 30, 2014
Timefilter Auto Refresh - Closes "Support for auto-refresh #1845"
@spalger spalger merged commit 1e348de into elastic:master Dec 30, 2014
@spalger
Copy link
Contributor

spalger commented Dec 30, 2014

@grouma that turned out to be a pretty epic pr. THANK YOU SO MUCH! This is a huge enhancement for K4.

If you're every in Phoenix let us buy you a beer 🍻

@grouma
Copy link
Contributor Author

grouma commented Jan 1, 2015

@spenceralger I agree! I thought it would be a small feature to get acquainted with the codebase. Sorry for fizzling out with the help near the end as the holidays took priority ;)

If you are ever in Seattle the same offer is there for you

@spalger spalger mentioned this pull request Jan 4, 2015
@w33ble
Copy link
Contributor

w33ble commented Jan 5, 2015

@grouma @spenceralger you guys killed it - this is a great feature that really came together. Nice work!

And @grouma, thanks so much for contributing, and for being patient with us ;)

@Blevene
Copy link

Blevene commented Feb 5, 2015

Was this implemented in Beta 3 from the main site (http://www.elasticsearch.org/overview/kibana/installation/)? I currently do not have the Time Filter "Refresh" Tab.

@grouma
Copy link
Contributor Author

grouma commented Feb 5, 2015

@Blevene This did not make it into Beta 3 in time. I expect it to be in the next beta.

@jamesmason84
Copy link

I'm really excited for this feature. Did it make it into v4.0.0, which was just released?

@spalger
Copy link
Contributor

spalger commented Feb 20, 2015

@jamesmason84 yep! You can find in in the time picker by clicking the time filter description on the right of the nav bar.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment