Checking order HTTP requests leave the connection pool?

24 views
Skip to first unread message

Jonathan Uesato

unread,
Jul 22, 2015, 8:04:01 PM7/22/15
to nodejs
I'm trying to use Node.js to make a series (~1000) of HTTP requests which are duplex connections. I'm worried that my GET and POST requests are not being sent out at the same time, because I get intermittent errors back from the server.

Is there a way to monitor HTTP requests as they are actually sent out? For example, is there some event which is emitted when they leave the connection pool? If it matters, I'm using the request library, though I imagine this shouldn't make too much of a difference.

Jeremy Darling

unread,
Jul 22, 2015, 11:09:12 PM7/22/15
to nodejs
Actually, yes, there is a way to intercept the http request/response mechanic.  This is some "working" code that I will be cleaning up at some point, but for now it could suffice as a reference.  Of course you can also use the precis-client-logger with the precis-file-adapter or precis-console-adapter if you don't want to rewrite it or copy/paste it.


Really though, your GET and POST won't got out at the same time, they might be close but they will never be exact.  Within a few 100ms would be my best guess.

On Wed, Jul 22, 2015 at 6:29 PM, Jonathan Uesato <jue...@gmail.com> wrote:
I'm trying to use Node.js to make a series (~1000) of HTTP requests which are duplex connections. I'm worried that my GET and POST requests are not being sent out at the same time, because I get intermittent errors back from the server.

Is there a way to monitor HTTP requests as they are actually sent out? For example, is there some event which is emitted when they leave the connection pool? If it matters, I'm using the request library, though I imagine this shouldn't make too much of a difference.

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/fb684ffb-6586-4a84-b9eb-9b2093ab91b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages