CloudWatch Custom Metrics

4,307 views

Published on

第9回 AWS User Group - Japan 東京勉強会でのLTです。

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
4,307
On SlideShare
0
From Embeds
0
Number of Embeds
754
Actions
Shares
0
Downloads
27
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

CloudWatch Custom Metrics

  1. 1. CloudWatch Custom Metricshttp://yfrog.com/z/klraqcxj (by @kirishimaru)
  2. 2. @dateofrock
  3. 3. follow me ! @dateofrock
  4. 4. http://d.hatena.ne.jp/mikeda/20110512/1305225982 http://d.hatena.ne.jp/j3tm0t0/20110517/1305651359 http://blog.suz-lab.com/2011/05/nagioscloudwatch_19.html http://blog.dateofrock.com/2011/05/cloudwatch-jxm-custommetrics.htmlhttp://blog.cloudpack.jp/2011/06/aws-news-cloudwatch-custom-metrics.html
  5. 5. //MemoryMXBean mBean = ManagementFactory.getMemoryMXBean();MemoryUsage heapUsage = mBean.getHeapMemoryUsage();
  6. 6. // DimensionDimension dimension = new Dimension() .withName("Server").withValue("server01");//PutMetricDataRequest request = new PutMetricDataRequest() .withNamespace("JVM").withMetricData( // Used new MetricDatum().withDimensions(dimension) .withMetricName("Used") .withUnit(StandardUnit.Bytes.toString()) .withValue((double) heapUsage.getUsed()) );
  7. 7. AWSCredentials cred = new BasicAWSCredentials( " ", " ");AmazonCloudWatchClient client = new AmazonCloudWatchClient(cred);// CloudWatchclient.putMetricData(request);
  8. 8. http://yfrog.com/z/klraqcxj (by @kirishimaru)
  9. 9. http://yfrog.com/z/klraqcxj (by @kirishimaru)

×