Easiest way to get paulirish's memory-stats.js memory stats and mrdoobs stats.js running in a rails app. Please refer to the memory-stats.js repo or stats.js repo for further documentation.
Add this line to your application's Gemfile:
gem 'memory-stats-js-rails'
And then execute:
$ bundle
Or install it yourself as:
$ gem install memory-stats-js-rails
Add to app/assets/javascripts/application.js
:
//= require memory-stats
And then something like:
var stats = new MemoryStats();
stats.domElement.style.position = 'fixed';
stats.domElement.style.right = '0px';
stats.domElement.style.bottom = '0px';
document.body.appendChild( stats.domElement );
requestAnimationFrame(function rAFloop(){
stats.update();
requestAnimationFrame(rAFloop);
});
- Fork it ( https://github.com/[my-github-username]/memory-stats-js-rails/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request