in metrics-core/src/main/java/software/amazon/swage/metrics/record/cloudwatch/CloudWatchRecorder.java [305:329]
public CloudWatchRecorder(
final AmazonCloudWatch client,
final String namespace,
final int maxJitter,
final int publishFrequency,
final DimensionMapper dimensionMapper,
final ScheduledExecutorService scheduledExecutorService)
{
if (client == null) {
throw new IllegalArgumentException("AmazonCloudWatch must be provided");
}
if (namespace == null || namespace.isEmpty()) {
throw new IllegalArgumentException("namespace must be provided");
}
if (dimensionMapper == null) {
throw new IllegalArgumentException("DimensionMapper must be provided");
}
this.metricsClient = client;
this.namespace = namespace;
this.publishExecutor = scheduledExecutorService;
this.aggregator = new MetricDataAggregator(dimensionMapper);
start(maxJitter, publishFrequency);
}