Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

CloudWatch Custom Metrics

4,438 views

Published on

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

Published in: Technology
  • Be the first to comment

  • Be the first to like this

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)

×