2

I'm working on a quite large nodejs code base which have been refactored and migrated from legacy to new service version several times and I highly suspect that some code is not used any more.

This dead code is still well tested, but I would like to get rid of it.

I had the idea to run 1 API server using Istanbul, put in in the production pool for some time (few minutes/hours/days) and see what code is actually useful (and identify probable dead code).

According to its documentation, Istanbul cover can handle long-lived processes, so this seems not to be an issue.

My concern is about memory overhead and potential slowness due to the instrumentation of the code, and more globally any thoughts, feedback and recommandation about getting code coverage based on real traffic would be very helpful.

Thanks!

Pierre
  • 45
  • 7

1 Answers1

1

Your best bet to do what you want would be to run your app on SmartOS, OmniOS or some other illumos/OpenSolaris distro and use DTrace.

See:

rsp
  • 107,747
  • 29
  • 201
  • 177
  • You can also dtrace node.js applications using FreeBSD 10.3 or above - Most hosting providers offer that. You will need to compile node.js with the `--with-dtrace` option – Number 9 Dec 07 '16 at 14:44