tom-pytel commented on pull request #20:
URL: https://github.com/apache/skywalking-nodejs/pull/20#issuecomment-752955707


   > Yep the tests result shows this problem exactly, and that's what I said 
without `on-finished` the efforts is not ignorable.
   
   Well, the asynchronous nature of JS will make this an interesting problem, 
especially for async client / servers. Will need to check that time reported is 
actual time taken and not just to return a Promise which may be similar on both 
client and server but not be the actual time of processing.
   
    As for http I am sure there is a way to do it, I may just duplicate part of 
`on-finished` mechanism locally (doesn't look too difficult).
   
   > P.S. I'm also finding some hooks of import / require that may avoid the 
problem of the different instances, something like 
https://stackoverflow.com/questions/24602136/import-hooks-in-node-js , need 
some tryings though
   
   I don't think the "problem" of different instances is something you want to 
"solve" globally. It is just how Node works and it is something to be aware of, 
but if you try to change it globally you may wind up breaking things you don't 
even know about. Also, does `import` use the `Module.prototype.require()` 
function internally or is it a different mechanism?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to