O'Reilly logo

Highcharts Cookbook by Nicholas Terwoord

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding CPU and memory usage graphs

When working with remote systems, it can be useful to know the status of the server. For example, it can be beneficial to know when a machine has run out of memory, or whether it is spending a lot of time doing computationally expensive work. In this recipe, we'll look at how we can use Node.js and Highcharts to understand a system's CPU and RAM usage graphs.

Getting ready

To set up a basic Node.js project and its dependencies, refer to the Getting Ready section of the Exploring hard drive usage recipe from this chapter.

How to do it...

To get started, perform the following steps:

  1. Create a handler for obtaining CPU information using the following code:
    app.use(express.static('static'));
    app.get('/cpu/', function(request, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required