Amazon CloudWatch PutMetricData Sample

This sample demonstrates using the AWS SDK for .NET to sample windows performance counters and use them as custom metrics in CloudWatch.

Prerequisites

Running the Sample

To run the Amazon CloudWatch PutMetricData sample:

  1. Open the Amazon_CloudWatch_Sample.sln file in Visual Studio.
  2. Open the App.config file.
  3. Enter your Access Key ID and Secret Access Key:
    <add key="AWSAccessKey" value="<Your Access Key ID>"/>   
    <add key="AWSSecretKey" value="<Your Secret Access Key>"/>
  4. Save the file.
  5. Run the sample in Debug mode by typing F5.
  6. The sample runs as a console application and updates two CloutWatch custom metrics once every minute, PagingFilePctUsage and PagingFilePctUsagePeak.
  7. It may take 15 minutes for these metrics to appear in the Amazon Cloudwatch console.
  8. Under metrics, in the left hand navigation, select 'EC2' under Metrics.
  9. Select the checkboxes for PagingFilePctUsage and PagingFilePctUsagePeak
  10. Select a time range of 24H, and a period of 5 minutes.

See the Amazon Cloudwatch product page for more inforamation about Amazon CloudWatch.