2.7 Simple Data Aggregations

DTrace provides several functions for aggregating the data that individual probes gather. These functions include avg(), count(), max(), min(), stddev(), and sum(), which return the mean, number, maximum value, minimum value, standard deviation, and summation of the data being gathered, respectively. See Aggregations in the Oracle Linux Dynamic Tracing Guide for descriptions of aggregation functions.

DTrace indexes the results of an aggregation by using a tuple expression that similar to what is used for an associative array:

@name[list_of_keys] = aggregating_function(args);

The name of the aggregation is prefixed with an @ character. The keys describe the data that the aggregating function is collecting. If you do not specify a name for the aggregation, DTrace uses @ as an anonymous aggregation name, which is usually sufficient for simple D programs.