jurre / memory-stats-js-rails

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

License:MIT License


Languages

Language:JavaScript 74.7%Language:Ruby 24.4%Language:Shell 0.9%