lloyd / node-toobusy

Build Node.JS servers that don't fall over.
1.3k stars 128 forks source link

Getting the lag value #23

Open jochenonline opened 10 years ago

jochenonline commented 10 years ago

Is there a chance to not only get a true or false on toobusy(), but also the measured lag time? This could be used to have a ongoing measurement of the loop's load.

jaybaker commented 10 years ago

I'm adding a +1 for this. I would love to be able to get back a number. This could be <= to the threshold set. I would like to call toobusy(300) and plot the values over time.

adrianpike commented 10 years ago

+1 as well.

adrianpike commented 10 years ago

After some brief code spelunking, I realized it's already there:

toobusy = require 'toobusy'
toobusy.lag()