Skip to content

Commit

Permalink
timeline-widget: autoadvance
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Asmuth committed Dec 19, 2011
1 parent 22935fb commit 196f13f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/fnordmetric/timeline_widget.rb
Expand Up @@ -9,6 +9,7 @@ def data
:start_timestamp => ticks.first,
:end_timestamp => ticks.last,
:autoupdate => (@opts[:autoupdate] || 0),
:include_current => !!@opts[:include_current],
:tick => tick
)
end
Expand Down
8 changes: 8 additions & 0 deletions pub/fnordmetric.js
Expand Up @@ -413,6 +413,14 @@ var FnordMetric = (function(){
if(secs > 0){

var autoupdate_interval = window.setInterval(function(){
if(
(parseInt(new Date().getTime()/1000) - opts.end_timestamp) >
(opts.include_current ? 0 : opts.tick)
){
opts.end_timestamp += opts.tick;
opts.start_timestamp += opts.tick;
}

redrawWithRange(false, true);
}, secs*1000);

Expand Down
2 changes: 1 addition & 1 deletion readme.rdoc
Expand Up @@ -287,7 +287,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
== Todos

-> fix include_current
-> timeline-widget: auto-advance
-> timeline-widget: areaspline-option
-> set_value / set_field
-> bars-widget
Expand All @@ -306,6 +305,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-> prune the namespace-event-types-list (trim to max items)
-> timelinewidget + numberswidget => should use redis hmget
-> get multiple metrics in a single http get
-> { _namespace: myns } field (!!!)


-> demo / example: chatroom;
Expand Down

0 comments on commit 196f13f

Please sign in to comment.