Saturday 29 December 2012

Nodetime in node.js

-->
Nodetime is node js app performance management tool set. This tool is for monitor and tracing application performance.It reveals the response time. Nodetime also supports HttpClient, cluster, file system, socket.io, MongoDb, Redis, PostgreSQL.

How to install nodetime with npm


npm install nodetime -g


then in project we need to include


require('nodetime').profile()

The high level profiler ruuning in app will securely sends profiling data to nodetime server.

when you start application, a link containing url and session_id will be printed to console.


ex:
https://nodetime.com/[session_id]

 How to get session_id

var nodetime=require('nodetime');      // nodetime is the variable, and  we are implementing module nodetime.


nodetime.on('session',function(id)
{
}).profile();

Methods:-

profile - starts the profiler. it contains some options.

headless , dtrace, stdout, debug.
what are these options
headless - if it true, no data will sent to the server.
dtrace     - It activates firing of Dtrace probes.
stdout     - if true, dumps using console.log().
debug     - used for debugging nodetime.



pause()  - it deactivates the profiler.

resume() - it activates the profile

resume([seconds])- it activates profiler for  given duration.

filter(test)- sets the sample filter.


0 comments:

Post a Comment