gemhome / fnordmetric

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

Simple example for Fnordmetric Class/UI does not work #65

Open bf4 opened 10 years ago

bf4 commented 10 years ago

Issue by JangoSteve Wednesday Aug 07, 2013 at 17:00 GMT Originally opened as https://github.com/paulasmuth/fnordmetric/issues/157


The fm_classic_simple_example doesn't actually work. When you implement the code on the page, you get this in the JavaScript console:

[FnordMetric] error: gauge not found... fnordmetric-ui.js?body=1:9483
bf4 commented 10 years ago

Comment by JangoSteve Wednesday Aug 07, 2013 at 17:48 GMT


Finally figured this out. The simple_example.rb is wrong in the documentation, it needs to include the gauge that the widget refers to as well:

require "fnordmetric"

FnordMetric.namespace :myapp do

  gauge :sales_per_minute,
    :title => "Sales per Minute Gauge"

  # render a timeseries graph
  widget 'Sales',
    :title => "Sales per Minute",
    :gauges => [:sales_per_minute],
    :type => :timeline,
    :width => 100,
    :autoupdate => 1

end

FnordMetric.standalone