It is well said that
We can only improve when we can measure or monitor
I know while developing an app using Node.js or any other technology, a good developer tries to build an optimised solution for every module he/she wrote.
But still, after our product goes into production there are many performance issues with that, depending on the load on the server, type of server, queries we are using to fetch data from the server and so on.
You cannot improve the performance just by guessing or picking any module. In order to find out weak parts which need improvisation, you have to monitor the each and every step or module.
Though this blog, I’ll try to give you brief about the tools which you can use to track or monitor your Node.js application.
First of all, you have to add tracking and logging for each and every method or API from its call to its response. For this you can use any one of the following:
There is a package called Winston which you can install via npm –
npm install winston
Winston is designed to be a simple and universal logging library with support for multiple transports. A transport is basically a storage/display mechanism for logs — it may be a DB, a web service, or simply console screen.
This can be simply used with Papertrail, which is log management solution that provides log storage, aggregation, search and analysis. Or with logentries, where you can monitor, analyse and visualise the analytical data.
Tracking based solutions
For keeping track of your application’s each and every action you can use Calq.io (I have used this in one of my application). Trust me it’s docs are very clear and it’s very effective for improving your app performance.
Calq provides custom analytics for mobile and web apps. Calq performs analytics based on actions that user’s take. We can track an action using calq.action.track. It is basically used to track user’s custom events. All users are assigned a unique identifier by the Calq client. We may, however, want to assign a different ID, such as our own user ID from your database. A common case for this is when a user registers or logs in. We can also clear the user when the user signs out.
In addition to sending data about actions, we can also send properties about users themselves. This allows us to analyse our audience based on who they are, rather than what they did.
Another widely used tool for monitoring or improving your app’s performance is New Relic. It provides a developer with a way to monitor or to diagnose and fix application performance problems in real time
To learn more about this tool, you can visit its official site or https://code.tutsplus.com/articles/3-new-relic-power-features-you-should-be-using-today–net-26015.
Meteor’s APM (Application Performance Monitoring)
This is a full package Application Performance Monitoring tool which is specifically design for Meteor applications.
This is now directly available to your Galaxy account (Galaxy is a Meteor platform for hosting Meteor Applications).
Just go to the settings of your application and click upgrade to professional button. Please refer to the screenshot below:
There we go, just click the Visit dashboard button
To get started with performance monitoring and improvement Meteor has really nice documents. Please visit http://galaxy-guide.meteor.com/apm-getting-started.html#Meteor-APM-Dashboard
I hope this blog might have helped you in monitoring and improving the performance of your application’s performance. And there are loads of other ways of doing this.
If you have any queries regarding any of the mentioned tool or you want more explanation then drop a comment on this blog. I’ll try to write a separate blog on each one of these.