proxygen icon indicating copy to clipboard operation
proxygen copied to clipboard

add transport stat ability for every handler

Open bluestn opened this issue 6 years ago • 1 comments

For User defined handler, there is no way to touch HTTPTransaction & RequestHandlerAdaptor directly, all is wrapped by author, so it is a little annoying thing that we cannot make an access log like the ngx_http_log_module does, because we cannot touch HTTPTransaction from user defined handler, and so cannot get the head or body bytes received from client, and also cannot get the head or body bytes sent to client easily.

Here, I add a TransactionStatProvider interface to RequestHandlerAdapter, and assign this interface to all handler while the handler is initializing. This TransactionStatProvider will store bytes receive from or sent to client, and the time point when request arrived. With this patch, in our handler, we can easily add the functionality to retrieve or even log the transaction stat information.

bluestn avatar Aug 27 '18 14:08 bluestn

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

facebook-github-bot avatar Aug 27 '18 14:08 facebook-github-bot

Well 6 years on we were bound to take a look. I'm sorry it took so long, but you also need to sign the CLA for us to move forward. These changes look mostly ok, but I assume things have moved on, and at least would need a rebase. Closing for now.

afrind avatar Sep 18 '24 21:09 afrind