README
LSK.js – stats
@lskjs/stats – LSK.js – stats – Module for count simple statistics
Table of contents
⌨️ Install
# yarn
yarn i @lskjs/stats
# npm
npm i @lskjs/stats
Example:
import ready from './polyfill';
import Stats from './Stats';
ready();
const stats = new Stats();
const startedAt = new Date();
setInterval(() => {
const event = Math.random() < 0.3 ? 'nack' : 'ack';
const proxy = Math.random() < 0.3 ? 'none' : `proxy_${Math.round((Math.random() * 10) % 10)}`;
let err;
if (event === 'nack') {
err = `code_${Math.round((Math.random() * 10) % 10)}`;
}
stats.trigger({ event, startedAt, err, proxy });
// stats.trigger({ event, startedAt, err, prefix: proxy });
stats.print();
}, 10);
📖 License
This project is licensed under the MIT License - see the LICENSE file for details
👥 Contributors
Igor Suvorov 💻 🎨 🤔 |
👏 Contributing
- Fork it (https://github.com/yourname/yourproject/fork)
- Create your feature branch (
git checkout -b features/fooBar
) - Commit your changes (
git commit -am 'feat(image): Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request