elasticsearch/kibana — pull request #2196 by grouma (2014-12-09 20:50:27+00:00)
Title: Timefilter Auto Refresh - Closes "Support for auto-refresh #1845"

Closes - Support for auto-refresh #1845

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. After application initialization a new refreshLoop is run every second. Within this loop the last refresh time is compared to the current time. If refreshInterval is non zero and the duration is larger than this refreshInterval, a "refresh" event is broadcast on the $rootscope. This allows any plugin to listen for this event and react accordingly. I have already updated the visualize, discover and dashboard plugins.

Notes:
I work at Microsoft so this branch also contains the Windows build and test fixes. This is necessary to ensure that I can build and run all tests.

![refreshfeature](https://cloud.githubusercontent.com/assets/1840773/5365526/bcfefcea-7fa1-11e4-99ae-8ca43dbc30ed.png)