mstats command: Examples

Examples for using the SPL2 mstats command.

Calculating a single metric grouped by time

The following example shows how to calculate a single metric grouped by time. This example returns the average value of the aws.ec2.CPUUtilization metric in the mymetricdata metric index. Use the bin command to bucket the results into 30 second time spans.

Combining metrics with different metric names

The following example combines metrics with different metric names. This example returns the average value of both the aws.ec2.CPUUtilization and os.cpu.utilization metrics. Group the results by host. Use the bin command to bucket the results into 1 minute time spans. Both metrics are combined and considered a single metric series.

Filtering results on a dimension value and split results by the values of another dimension

The following example filters the results on a dimension value and splits by the values of another dimension. This example returns the average value of the aws.ec2.CPUUtilization metric for all measurements with host=www2. The results are grouped by the values of the app dimension.

Specifying multiple aggregations of various metrics arranged by metric_name and put the results into 1 minute bins

The following example specifies multiple aggregations of multiple metrics. This example returns the average and maximum of the resident set size and virtual memory size. The results are grouped by the metric_name. The bin command is used to bucket the results into 1 minute spans.

Calculating the rate of an accumulating counter metric and group the results by time series

The following example calculates the rate of an accumulating counter metric and groups the results by time series. See Perform statistical calculations on metric time series in Metrics for more information.

Count of all of the measurements for a specific metric in an index

The following example returns a count of all of the measurements for the aws.ec2.CPUUtilization metric in the mymetricdata index.

See also