Easy performance monitoring for JavaScript / React
npm install @helpscout/stats

> Easy performance monitoring for JavaScript / React
- Installation
- Usage
- JavaScript
- React
- Graphs
- Options
- Thanks
Add stats to your project via npm install:
```
npm install --save @helpscout/stats
To use Stats in your JavaScript project, simply import it and instantiate!
`js
import createStats from '@helpscout/stats'
const stats = createStats()
// Stats will automatically mount to window.document
// For clean up, execute the destroy() method
stats.destroy()
`
Stats comes with a handy component. To add it to your React project, import it and render it:
`jsx
import React from 'react'
import {StatsGraph} from '@helpscout/stats'
class App extends React.Component {
render() {
return (
export default App
`
StatsGraph cleans up after itself if it unmounts.
- FPS Frames rendered in the last second. The higher the number the better.
- MB MBytes of allocated memory. (Run Chrome with --enable-precise-memory-info)
- NODES Number of DOM nodes in window.document (including iFrame nodes).
Stats accepts a handful of options to adjust it's position and UI.
| Prop | Type | Default | Description |
| -------- | ----------------- | -------- | --------------------------- |
| top | number/string | 0 | (CSS) top position. |number
| right | /string | 0 | (CSS) right position. |number
| bottom | /string | 0 | (CSS) bottom position. |number
| left | /string | 0 | (CSS) left position. |number
| opacity | | 0.5 | Opacity for the Stats UI. |string
| position | | fixed | Position for the Stats UI. |string
| zIndex | | 99999999 | z-index for the Stats UI. |
The React StatsGraph uses the same options for it's defaultProps`
Thanks for mrdoob for his stats.js library, which inspired this one!