Class CloudWatchDynamoDbMetricGenerator
- java.lang.Object
-
- pl.wrzasq.lambda.metrics.dynamodb.service.CloudWatchDynamoDbMetricGenerator
-
public class CloudWatchDynamoDbMetricGenerator extends Object
CloudWatch metrics handler.
-
-
Field Summary
Fields Modifier and Type Field Description private com.amazonaws.services.cloudwatch.AmazonCloudWatch
cloudWatch
AWS CloudWatch client.private com.amazonaws.services.dynamodbv2.AmazonDynamoDB
dynamoDb
AWS DynamoDB client.private org.slf4j.Logger
logger
Logger.private String
namespace
Metrics namespace to use.
-
Constructor Summary
Constructors Constructor Description CloudWatchDynamoDbMetricGenerator(com.amazonaws.services.dynamodbv2.AmazonDynamoDB dynamoDb, com.amazonaws.services.cloudwatch.AmazonCloudWatch cloudWatch, String namespace)
Initializes object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
generateMetrics(String tableName)
Table metrics generator.private void
putSingleMetric(String tableName, String metricName, double value, com.amazonaws.services.cloudwatch.model.StandardUnit unit)
Saves single metric value in CloudWatch.
-
-
-
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.
-
-