Class Handler
- java.lang.Object
-
- pl.wrzasq.lambda.metrics.dynamodb.Handler
-
public class Handler extends Object
CloudWatch Events request handler.Required environment variables:
METRICS_NAMESPACE
- Namespace to use for CloudWatch metrics.
Recommended memory: 256MB.
-
-
Field Summary
Fields Modifier and Type Field Description private CloudWatchDynamoDbMetricGenerator
metricGenerator
DynamoDB metrics generator.private static String
METRICS_NAMESPACE
Metrics namespace to use.private com.fasterxml.jackson.databind.ObjectMapper
objectMapper
JSON handler.
-
Constructor Summary
Constructors Constructor Description Handler()
Default constructor.Handler(com.fasterxml.jackson.databind.ObjectMapper objectMapper, CloudWatchDynamoDbMetricGenerator metricGenerator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
handle(InputStream inputStream, OutputStream outputStream)
Handles invocation.
-
-
-
Field Detail
-
METRICS_NAMESPACE
private static final String METRICS_NAMESPACE
Metrics namespace to use.
-
objectMapper
private com.fasterxml.jackson.databind.ObjectMapper objectMapper
JSON handler.
-
metricGenerator
private CloudWatchDynamoDbMetricGenerator metricGenerator
DynamoDB metrics generator.
-
-
Constructor Detail
-
Handler
public Handler()
Default constructor.
-
Handler
public Handler(com.fasterxml.jackson.databind.ObjectMapper objectMapper, CloudWatchDynamoDbMetricGenerator metricGenerator)
-
-
Method Detail
-
handle
public void handle(InputStream inputStream, OutputStream outputStream) throws IOException
Handles invocation.- Parameters:
inputStream
- Request input.outputStream
- Output stream.- Throws:
IOException
- When JSON loading/dumping fails.
-
-