Parameter Settings

The parameters displayed by the stripchart can be examined and edited using the Parameter Editor window. Although stripchart provides great potential for adding custom parameters, most users will initially be satisfied with the selecting from the list of pre-configured parameters supplied. Adding or deleting these parameters is described in the section called Parameter Editor Quickstart Guide.

Figure 10. Parameter Window

Parameter Editor Quickstart Guide

To delete one of the currently active parameters:

To add one of the pre-defined parameters:

Creating Custom Parameters

The creation of a custom parameter can be done by editing an existing parameter, by adding a new parameter and editing it, or by adding a new parameter and filling in the parameter fields from scratch. Many of the parameter fields can be left blank. While good style dictates that a parameter name and description be provided for documentation purposes, the only mandatory fields are those required to obtain a value to be plotted. Generally, the Equation field will fill this role. The details of each of these fields are described below.

Parameter

A short descriptive name for the parameter.

Description

A longer description of the parameter.

Filename

The name of a file from which equation parameters are obtained. On each iteration, a line is read from this file. If a pattern was supplied, lines are read until one is found that contains the pattern string anywhere in the line. This line is split into a series of whitespace separated fields, each of which is interpreted as a floating point number. The first (or only) value is denoted by $1, the next by $2, and so forth. The difference between the field values from the previous to the current iteration is denoted by ~1, ~2, and so forth.

If a filename beginning with a "|" is supplied, input lines will be read from a pipe instead of a file. Lines read from this pipe will be processed identically to lines read from a file as described previously.

If a filename beginning with a "?" is supplied, the file status determines the value to be plotted: -1 for a non-existent file, 0 for a file of zero length, 1 for a file with an access time that is newer than its modification time, and 2 for a file with a modification time that is newer than its access time. These values are useful in displaying the status of a mailbox file.

Equation

An equation used to obtain the value to be plotted for this parameter. The equation is made up of parameters which are combined using the usual infix arithmetic operators.

There are several sources for equation parameters.

  • The parameters can be obtained by reading a line from a file. This method of obtaining equation parameters is described under the previous Filename section.

  • There are a number of built-in parameters. The elapsed time in seconds between the last and current iteration is ~t. The requested update interval is $i, and the delta (which will always be zero) is ~i.

  • There are a number of parameters provided by the libgtop library. These are described in the section called libgtop Values.

The usual infix arithmetic operators — addition (+), subtraction (-), multiplication (*), division (/), and remaindering (%) — are available, along with parenthesis for grouping subexpressions, and unary minus (-) to negate a value. Grouping and negation have the highest precedence; multiplication, division, and remaindering have the next highest precedence; and addition and subtraction have the lowest precedence.

Pattern

If the filename field specifies a file containing more than a single line of text, the pattern field can be used to select the line from which equation parameter values will be obtained. Lines will be read from the file until a line containing the specified pattern is found, or until the end of file is reached. If no pattern is provided, the first line of the file is used.

Top Min, Top Max, Bottom Min, Bottom Max

The minimum and maximum to be used for the value at the top and bottom of the chart.

Scale

The type of scaling to be performed on the parameter values before they are plotted: either linear or logarithmic.

Type

The type of plot to be generated for this parameter value. The value can be plotted as an indicator, a small square in the upper left corner of the window; as a line drawn between successive parameter values; as a point for each parameter value; or as a solid, with the area below each parameter value solidly filled in.

Color

The color or colors to be used when plotting this parameter value. For an indicator plot, a series of colors are used, the first for parameter values of one, plus or minus one-half, two, plus or minus one-half, three, plus or minus one-half, and so on. For line, point, and solid plot types, only a single color is used.

libgtop Values

Normally, the stripchart program will be built with the libgtop library linked in. The libgtop library provides a portable and well-standardized method of accessing common system performance parameters. This is the preferred method of obtaining a value to be plotted.

The following libgtop parameters are available:

These are all signed long integer quantities, except for uptime, idletime, and the five load values which are floating point values.