kezhenxu94 commented on pull request #20: URL: https://github.com/apache/skywalking-nodejs/pull/20#issuecomment-752957990
> 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. Exactly. > 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). Hopefully this can be extracted as an individual reusable module / class. Also note not to copy the codes from on-finished because of licensing issues. > > > 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 the last sort if it really needs. Just to search and see we have a fallback solution. ---------------------------------------------------------------- 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]
