How to integrate FnordMetric app into rails

I want to view a chart format using dynamic data in a rails applicaiton.

So I am trying to integrate FnordMetric into my application

I have installed

gem 'fnordmetric'

      

and followed the steps outlined here http://railscasts.com/episodes/378-fnordmetric?view=asciicas

I can run the file with the ruby ​​command and the diagram is displayed at localhost: 4242

But I want to run FnordMetric with rails instead of running with ruby ​​command and want to display the chart in rails app instead of other port like localhost: 4242

Can I use it?

+3


source to share


1 answer


You can view this article .

But, briefly. I am assuming that you have successfully followed the steps from the article you gave.

  • Add to app / assets / javascripts folder fnordmetric-ui.js
  • Add to app / assets / stylesheets folder fnordmetric-ui.css
  • Add to your view (say index.html)


In index.html:

<script>
  FnordMetric.setup({
    "address":   "localhost:4242",
    "namespace": "store"
  });
</script>


  <div
  data-fnordmetric="timeseries"
  data-gauges="product_views_per_second"
  data-since="-60m"
  data-until="now"
  data-autoupdate="1"
  ></div>

      

The documentation gives the wrong url to download the fnordmetric-ui.js and fnordmetric-ui.css files. I found them here .

+2


source







All Articles