Skip to content

jurre/memory-stats-js-rails

Repository files navigation

MemoryStatsJsRails

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.

image

Installation

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

Usage

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);
});

Contributing

  1. Fork it ( https://github.com/[my-github-username]/memory-stats-js-rails/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

paulirish's memory-stats.js as a rails gem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published