@rill/stats

Simple browser performance monitoring.

Usage no npm install needed!

<script type="module">
  import rillStats from 'https://cdn.skypack.dev/@rill/stats';
</script>

README

Rill
@rill/stats
API stability Standard NPM version Downloads Gitter Chat

Adds a simple browser performance monitoring to a Rill app. The performance monitoring is powered by stats.js.

Installation

npm install @rill/stats

Example

var app = require('rill')()
var stats = require('@rill/stats')

// Every request will be measured with stats.js.
app.use(stats({ mode: "ms" }))

Default modes

(Click on the frame to switch between modes).

{
    "ms" // monitor (avg) ms during requests.
    "mb" // monitor current MBytes of allocated memory.
    "fps"// monitor (avg) fps during requests (typically useless).
}

Production Use

@rill/stats exposes a noop function when "process.env.NODE_ENV" is true. This allows for build tools such as babel, browserify or webpack to remove this functionality for production sites.

Contributions

  • Use npm test to run tests.

Please feel free to create a PR!