-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: How to use it in the context of a webserver like Express.js #7
Comments
Hey @roundrobin, that should just work :/. Can you link me to the actual code? |
is it able to print all the stacks of code, for example if i use MVC in express, the stack print should be "Controller","Service","DB" ? |
@clevertension In theory, yes. You'd have to modify the code, or use your own output printer though. |
@roundrobin's code works correctly for me, however if I use You can run this and see: var AsyncProfile = require('async-profile'),
request = require("request");
function someEndpoint() {
var profiler = new AsyncProfile({
callback: function(results) {
results.print();
}
});
request("http://google.com", function() {
// profiler stops right before this callback.
console.log("loaded google");
});
// wait 5 seconds and then stop
setTimeout(function returnCallback() {
console.log("really stop");
profiler.stop();
}, 5000);
}
someEndpoint(); |
That's probably because |
I tried using async-profile within an endpoint of an express app, but I can't get it to work. Its immediately returning of making a instance an within the endpoint. Here a stripped down demo of my code:
The text was updated successfully, but these errors were encountered: