Class CloudWatchDynamoDbMetricGenerator


  • public class CloudWatchDynamoDbMetricGenerator
    extends Object
    CloudWatch metrics handler.
    • Field Detail

      • logger

        private org.slf4j.Logger logger
        Logger.
      • dynamoDb

        private com.amazonaws.services.dynamodbv2.AmazonDynamoDB dynamoDb
        AWS DynamoDB client.
      • cloudWatch

        private com.amazonaws.services.cloudwatch.AmazonCloudWatch cloudWatch
        AWS CloudWatch client.
      • namespace

        private String namespace
        Metrics namespace to use.
    • Constructor Detail

      • CloudWatchDynamoDbMetricGenerator

        public CloudWatchDynamoDbMetricGenerator​(com.amazonaws.services.dynamodbv2.AmazonDynamoDB dynamoDb,
                                                 com.amazonaws.services.cloudwatch.AmazonCloudWatch cloudWatch,
                                                 String namespace)
        Initializes object.
        Parameters:
        dynamoDb - DynamoDB client.
        cloudWatch - CloudWatch client.
        namespace - Metrics namespace.
    • Method Detail

      • generateMetrics

        public void generateMetrics​(String tableName)
        Table metrics generator.
        Parameters:
        tableName - Table name.
      • putSingleMetric

        private void putSingleMetric​(String tableName,
                                     String metricName,
                                     double value,
                                     com.amazonaws.services.cloudwatch.model.StandardUnit unit)
        Saves single metric value in CloudWatch.
        Parameters:
        tableName - DynamoDB table name.
        metricName - Metric name.
        value - Metric value.
        unit - Metric unit.