Last updated 2 years ago by Vladimir De Turckheimnodejs
When running a web application in production, performance is important. Slow web servers provide degraded user experience and can threaten a whole company’s business.
In order to fully understand how a web application runs in production, load testing is not enough. Even if tools like ab can give measures regarding how fast a server answers under a specific load, they can’t tell you where the bottlenecks are.
In this article, we will build a tool that will monitor how much time is spent in MongoDB when a simple Node.js application answers an HTTP request.
As a developer, I want to be able to know how much time my server spends in external services when answering an HTTP request.
For this article, let’s look at the simple Express/Mongoose application here:
For this application, we want to monitor the time spent in MongoDB for each HTTP request.
Also, in this article, we will only use the async/await syntax.