Statistics (Aggregates); The Aggregation (<<<) Operator; Extraction Functions; Integer Extractors - Red Hat ENTERPRISE LINUX 5.4 - SYSTEMTAP LANGUAGE Reference Manual

Systemtap language reference
Hide thumbs Also See for ENTERPRISE LINUX 5.4 - SYSTEMTAP LANGUAGE:
Table of Contents

Advertisement

Chapter 8.

Statistics (aggregates)

Aggregate instances are used to collect statistics on numerical values, when it is important to
accumulate new data quickly and in large volume. These instances operate without exclusive locks,
and store only aggregated stream statistics. Aggregates make sense only for global variables. They
are stored individually or as elements of an array.
8.1. The aggregation (<<<) operator
The aggregation operator is "<<<", and its effect is similar to an assignment or a C++ output streaming
operation. The left operand specifies a scalar or array-index l-value, which must be declared global.
The right operand is a numeric expression. The meaning is intuitive: add the given number to the set
of numbers to compute their statistics. The specific list of statistics to gather is given separately by the
extraction functions. The following is an example.
a <<< delta_timestamp
writes[execname()] <<< count

8.2. Extraction functions

For each instance of a distinct extraction function operating on a given identifier, the translator
computes a set of statistics. With each execution of an extraction function, the aggregation is
computed for that moment across all processors. The first argument of each function is the same style
of l-value as used on the left side of the aggregation operation.

8.3. Integer extractors

The following functions provide methods to extract information about integer values.

8.3.1. @count(s)

This statement returns the number of all values accumulated into s.

8.3.2. @sum(s)

This statement returns the total of all values accumulated into s.

8.3.3. @min(s)

This statement returns the minimum of all values accumulated into s.

8.3.4. @max(s)

This statement returns the maximum of all values accumulated into s.

8.3.5. @avg(s)

This statement returns the average of all values accumulated into s.
35

Advertisement

Table of Contents
loading

Table of Contents