gemhome / fnordmetric

(possible new home for) FnordMetric is a redis/ruby-based realtime Event-Tracking app
0 stars 1 forks source link

Timeseries Widget (NoMethodError error for tick.last) #69

Open bf4 opened 10 years ago

bf4 commented 10 years ago

Issue by anapsix Thursday Aug 22, 2013 at 17:35 GMT Originally opened as https://github.com/paulasmuth/fnordmetric/issues/163


Dashboard Timeseries Widget trowing NoMethodError exception NoMethodError - undefined method `last' for #<Enumerator: 1377191030..1377191330:step(10)>

NoMethodError - undefined method `last' for #:
    /var/lib/gems/1.9.1/gems/fnordmetric-1.2.9/lib/fnordmetric/widgets/timeseries_widget.rb:35:in `data'
    /var/lib/gems/1.9.1/gems/fnordmetric-1.2.9/lib/fnordmetric/widget.rb:75:in `render'
    /var/lib/gems/1.9.1/gems/fnordmetric-1.2.9/lib/fnordmetric/web/dashboard.rb:34:in `block (2 levels) in to_json'
    /var/lib/gems/1.9.1/gems/fnordmetric-1.2.9/lib/fnordmetric/web/dashboard.rb:33:in `each'
    /var/lib/gems/1.9.1/gems/fnordmetric-1.2.9/lib/fnordmetric/web/dashboard.rb:33:in `block in to_json'
    /var/lib/gems/1.9.1/gems/fnordmetric-1.2.9/lib/fnordmetric/web/dashboard.rb:32:in `tap'
    /var/lib/gems/1.9.1/gems/fnordmetric-1.2.9/lib/fnordmetric/web/dashboard.rb:32:in `to_json'
    /var/lib/gems/1.9.1/gems/fnordmetric-1.2.9/lib/fnordmetric/web/app.rb:59:in `block in '
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1415:in `call'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1415:in `block in compile!'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:944:in `[]'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:944:in `block (3 levels) in route!'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:960:in `route_eval'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:944:in `block (2 levels) in route!'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:981:in `block in process_route'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:979:in `catch'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:979:in `process_route'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:943:in `block in route!'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:942:in `each'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:942:in `route!'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1053:in `block in dispatch!'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1035:in `block in invoke'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1035:in `catch'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1035:in `invoke'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1050:in `dispatch!'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:878:in `block in call!'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1035:in `block in invoke'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1035:in `catch'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1035:in `invoke'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:878:in `call!'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:864:in `call'
    /var/lib/gems/1.9.1/gems/rack-protection-1.5.0/lib/rack/protection/xss_header.rb:18:in `call'
    /var/lib/gems/1.9.1/gems/rack-protection-1.5.0/lib/rack/protection/path_traversal.rb:16:in `call'
    /var/lib/gems/1.9.1/gems/rack-protection-1.5.0/lib/rack/protection/json_csrf.rb:18:in `call'
    /var/lib/gems/1.9.1/gems/rack-protection-1.5.0/lib/rack/protection/base.rb:49:in `call'
    /var/lib/gems/1.9.1/gems/rack-protection-1.5.0/lib/rack/protection/base.rb:49:in `call'
    /var/lib/gems/1.9.1/gems/rack-protection-1.5.0/lib/rack/protection/frame_options.rb:31:in `call'
    /var/lib/gems/1.9.1/gems/rack-1.5.2/lib/rack/nulllogger.rb:9:in `call'
    /var/lib/gems/1.9.1/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/showexceptions.rb:21:in `call'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:172:in `call'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1947:in `call'
    /var/lib/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
    /var/lib/gems/1.9.1/gems/rack-1.5.2/lib/rack/urlmap.rb:65:in `block in call'
    /var/lib/gems/1.9.1/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in `each'
    /var/lib/gems/1.9.1/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in `call'
    /var/lib/gems/1.9.1/gems/rack-1.5.2/lib/rack/showexceptions.rb:24:in `call'
    /var/lib/gems/1.9.1/gems/rack-1.5.2/lib/rack/commonlogger.rb:33:in `call'
    /var/lib/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:209:in `call'
    /var/lib/gems/1.9.1/gems/thin-1.5.1/lib/thin/connection.rb:81:in `block in pre_process'
    /var/lib/gems/1.9.1/gems/thin-1.5.1/lib/thin/connection.rb:79:in `catch'
    /var/lib/gems/1.9.1/gems/thin-1.5.1/lib/thin/connection.rb:79:in `pre_process'
    /var/lib/gems/1.9.1/gems/websocket-rack-0.4.0/lib/rack/websocket/extensions/thin/connection.rb:17:in `pre_process_with_websocket'
    /var/lib/gems/1.9.1/gems/fnordmetric-1.2.9/lib/fnordmetric/ext.rb:72:in `pre_process'
    /var/lib/gems/1.9.1/gems/thin-1.5.1/lib/thin/connection.rb:54:in `process'
    /var/lib/gems/1.9.1/gems/thin-1.5.1/lib/thin/connection.rb:39:in `receive_data'
    /var/lib/gems/1.9.1/gems/websocket-rack-0.4.0/lib/rack/websocket/extensions/common.rb:32:in `receive_data_with_websocket'
    /var/lib/gems/1.9.1/gems/websocket-rack-0.4.0/lib/rack/websocket/extensions/common.rb:60:in `receive_data_with_flash_policy_file'
    /var/lib/gems/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
    /var/lib/gems/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
    /var/lib/gems/1.9.1/gems/fnordmetric-1.2.9/lib/fnordmetric.rb:84:in `start_em'
    /var/lib/gems/1.9.1/gems/fnordmetric-1.2.9/lib/fnordmetric.rb:104:in `standalone'
    viz.rb:40:in `
'

Running fnordmetric on Debian Wheezy (7.1) 64bit

$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
$ gem -v
1.8.23

Easily fixed by converting tick to array.

bf4 commented 10 years ago

Comment by vuliad Saturday Nov 16, 2013 at 12:56 GMT


using this http://fnordmetric.io/documentation/examples/fm_classic_full_example/ not working - same issue.

bf4 commented 10 years ago

Comment by anapsix Monday Nov 18, 2013 at 17:43 GMT


Consider Pull Request https://github.com/paulasmuth/fnordmetric/pull/164 or a https://github.com/paulasmuth/fnordmetric/pull/164#issuecomment-23856784 by @elia