Testing Node can also require a more scientific, experimental effort. For example, memory leaks are notoriously difficult bugs to track down. You will need powerful process profiling tools to take samples, test scenarios, and get a grip on just where the problem is coming from. If you are designing a log analysis and summarization tool that must crunch through gigabytes of data, you might want to test out various parsing algorithms and rank their CPU/memory usage. Whether testing the existing processes or being a software engineer, gathering information on resource usage is important. What we will look at in this section is how to take data snapshots of running processes, and how to draw useful information out of them.
Node already provides some process information natively. Basic tracking of how much memory your Node process is using is easy to fetch with...