Menu
Amazon Elastic Compute Cloud
User Guide for Windows Instances

Get Statistics for a Specific Instance

The following examples show you how to use the AWS Management Console or the AWS CLI to determine the maximum CPU utilization of a specific EC2 instance.

Requirements

To display the CPU utilization for a specific instance using the console

  1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.

  2. In the navigation pane, choose Metrics.

  3. Select the EC2 metric namespace.

    
              Select the EC2 metrics namespace
  4. Select the Per-Instance Metrics dimension.

    
              View the metric dimensions for Amazon EC2
  5. In the search field, type CPUUtilization and press Enter. Select the row for the specific instance, which displays a graph for the CPUUtilization metric for the instance. To name the graph, choose the pencil icon. To change the time range, select one of the predefined values or choose custom.

    
              Graph a single metric
  6. To change the statistic or the period for the metric, choose the Graphed metrics tab. Choose the column heading or an individual value, and then choose a different value.

    
              Change the statistic or period for a metric

To get the CPU utilization for a specific instance using the AWS CLI

Use the following get-metric-statistics command to get the CPUUtilization metric for the specified instance, using the specified period and time interval:

Copy
aws cloudwatch get-metric-statistics --namespace AWS/EC2 --metric-name CPUUtilization --period 3600 \ --statistics Maximum --dimensions Name=InstanceId,Value=i-1234567890abcdef0 \ --start-time 2016-10-18T23:18:00 --end-time 2016-10-19T23:18:00

The following is example output. Each value represents the maximum CPU utilization percentage for a single EC2 instance.

{
    "Datapoints": [
        {
            "Timestamp": "2016-10-19T00:18:00Z", 
            "Maximum": 0.33000000000000002, 
            "Unit": "Percent"
        }, 
        {
            "Timestamp": "2016-10-19T03:18:00Z", 
            "Maximum": 99.670000000000002, 
            "Unit": "Percent"
        }, 
        {
            "Timestamp": "2016-10-19T07:18:00Z", 
            "Maximum": 0.34000000000000002, 
            "Unit": "Percent"
        }, 
        {
            "Timestamp": "2016-10-19T12:18:00Z", 
            "Maximum": 0.34000000000000002, 
            "Unit": "Percent"
        }, 
        ...
    ], 
    "Label": "CPUUtilization"
}