Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/allevo/jstuning
Inspect your code to track its performance
https://github.com/allevo/jstuning
Last synced: 14 days ago
JSON representation
Inspect your code to track its performance
- Host: GitHub
- URL: https://github.com/allevo/jstuning
- Owner: allevo
- License: mit
- Created: 2014-12-13T21:47:45.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-18T20:40:43.000Z (almost 10 years ago)
- Last Synced: 2024-10-06T17:17:52.652Z (about 1 month ago)
- Language: JavaScript
- Size: 156 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
JS Tuning
=======[![Build Status](https://travis-ci.org/allevo/jstuning.svg)](https://travis-ci.org/allevo/jstuning)
Inspect your code to track its performance
Are you looking for a tool to track your code performance?
This is the project made for you!
With only 2 line, you can track all main issuer like db or http queries.
## How
In first, you should create your handler. The handler is a function that will be invoked when a metric is calculated.
For instance we'll use console.log function.
```javascript
var myhandler = console.log.bind(null, 'Metric:');
```You can send this metric to somewhere, where you prefer.
Please note: in the following example, we use the packages of the app beacuse this tool wrap all methods we need.
### Mongodb
```javascriptvar mongodb = require('mongodb');
// pass same instance you use
require('jstuning').mongodb(mongodb, myhandler);```
### Mongoose
```javascriptvar mongoose = require('mongoose');
// pass same instance you use
require('jstuning').mongoose(mongoose, myhandler);```
So difficult, right?
## Why?
In my experience, nodejs is a great language. My idea starts from a real problem: how my code performs?
So I haven't found a tool that permits me to track all elapsed time. This tool aimed to give you a canche to give all elapsed time and send them to some tool like Gathering or StatsD.This project is free and has a very low integration cost. So, why not?
## TODO
I've started but there're lot of things do to. I'd like to integrate major packages.
* async
* underscore / lodash
* ~~Mongodb native driver~~
* Mongoose (partially)
* request
* connect / expressjs middelware
* sequelizejs
* ...So all your contributes are accepted and welcomed!
I'm started from packages I'm used to.