Architecture

Home | Architecture | Features | Documentation | Releases | FAQ | Support

The following block diagram shows that collectl is much more than a tool that reads data from /proc and writes its results into a file or on the terminal. Spending a few minutes studying this diagram may help to gain a better understanding about the different ways you might use collectl more effectively. As you can see, there are a variety of paths data can follow and the ones it takes depends on the switches you select. For clarity I have not included all possibilities.

Interactive Mode

This is the default and in this mode data is read from /proc and passes through analyze. It is really nothing more than a function that looks at the change between the current and previous values. It then divides by the duration of the interval (unless you specicify -on) and produces the rate, for those values that are indeed rate based. This function is also responsible for formatting/disposing the output. More on that in a little while.

Record Mode

Data passes from /proc the same way as Interactive Mode but instead of going through the Analyze function it written it to a file. By eliminating the calculations and formatting, this is the most efficient path the data can take and is why collectl it so light-weight when run in this way.

Playback Mode

Here collectl works virtually identical to Interactive Mode except instead of reading data from /proc it reads it from a file. This means all the switches that control data formatting still apply. There are also a couple of switches that allow you to select the time period from which you want to play back data.

Plot Format

When you select the -P switch, it directs the formatting of the data to be delimitter separated (the default is to use spaces) on a single line, starting with the date and time. Typically you also include the -f switch to name the location to write the data to. If you leave off the -f, collectl will send the data to your terminal which isn't particularly useful.

Socket

When you run collectl with -A and specify an address and optional port number (the default is 2655 or the first for letters of collectl on a telephone keypad), rather than writing its output to the display or a plot file, collectl will send its data to a socket at the address specified.

Custom Output

Greyed out because this isn't the main way collectl is used, but also to help keep the drawing simpler, collectl has the ability to bypass its standard routines for formatting interactive data and call a custom formatting routine instead. A side benefit is that if these routines choose to call a standard collectl output routine that has socket knowledge, the output will go over a socket when one has been opened. In some cases these custom routines may even chose to write output to a file of their choice, which is the case of 3 routines delivered as part of the standard kit, namely lexpr, graphite and gexpr.