The Application Metrics for Node.js monitoring dashboard has been relaunched with a brand new UI providing a range of metrics including HTTP requests and event loop latency.

Installation

Adding monitoring to your application is very straightforward in most cases, requiring just one additional line added to the top of your main javascript source file:

require('appmetrics-dash').monitor()

After starting your application you can then navigate to <hostname>:<port>/appmetrics-dash in a browser (localhost:3001/appmetrics-dash is the default if running locally).

A more in depth guide can be found here.

Understanding the data


Dashboard Screenshot

Most of the data is plotted as line graphs. HTTP Incoming Requests, HTTP Outgoing Requests and Other Requests show event duration against time. HTTP Throughput shows requests per second. Average Response Times (top 5) shows the 5 incoming HTTP requests that took the longest on average. CPU and Memory graphs show system and process usage over time. Heap shows the maximum heap size and used heap size over time. Event Loop Latency shows latency samples taken at intervals from the Node.js event loop, with one point for the shortest latency, one for the average and one for the longest for each sample taken.

If a graph has points, hovering over one of these points will give additional information. For example ‘HTTP Incoming Requests’ will show the response time and the requested url.

A maximum of 15 minutes of data is shown across all graphs.

If a lot of data is being produced by the application being monitoring then the dashboard will automatically start to aggregate data. Looking at the HTTP Incoming Requests chart again, each point will represent all the requests for a 2 second period. The tooltip shows the total number of requests along with the average time taken and the longest time. The longest time is the value actually plotted.


Diagnosing Problems

The Application Metrics Dashboard can help you to identify common performance problems such as:

  1. Slow HTTP response times on some or all routes
  2. Lower than expected throughput in the application
  3. Spikes in demand causing slowdown
  4. Higher than expected CPU usage for the level of throughput/load
  5. High and/or growing memory usage (potential memory leak)

In addition, the ‘Other Requests’ chart shows database request duration for supported databases (MongoDB, MySQL, Postgres, LevelDB and Redis), as well as Socket.IO and Riak events, which could help you further identify where time is being spent in your application.

A Node Report or a Heap Snapshot can be generated from the dashboard at the click of a button to enable more in-depth analysis.

Join The Discussion

Your email address will not be published. Required fields are marked *