public void sendGreetings(Integer numberOfGreetings, Long timeBetweenSendsInMillis) throws InterruptedException {
        final String greetingZeroId = "greeting-00";
        final Greeting greetingZero = new Greeting();
        greetingZero.setId(greetingZeroId);
        greetingZero.setName(greetingZeroId);

        for (int i = 0; i < numberOfGreetings; i++) {
            LOGGER.info("Sending greeting #{}", i + 1);
            final String greetingId = String.format("greeting-%2d", i);
            final Greeting greeting = new Greeting();
            greeting.setId(greetingId);
            greeting.setName(greetingId);

            putGreeting(greeting);
            putGreeting(greetingZero);
            getGreeting(greetingId);
            getGreeting(greetingZeroId);

            // Briefly pause the loop to extend the requests over a longer period to generate metrics
            // for this example.
            Thread.sleep(timeBetweenSendsInMillis);
        }
    }
@Test
    @Tag("IntegrationTest")
    void sendGreetings() {
        String namespace = "DynamoDBMetricsExample" + "Text" + new Random(1000);

        GreetingsSender greetingsSender = new GreetingsSender(REGION, Duration.ofSeconds(15L), namespace);
        greetingsSender.createTable();
        try {
            greetingsSender.sendGreetings(5, 2500L);
            Thread.sleep(Duration.ofSeconds(30L).toMillis());
            ListMetricsResponse listMetricsResponse = cloudWatchClient.listMetrics(b -> b
                    .namespace(namespace)
                    .metricName(CoreMetric.API_CALL_DURATION.name()));

            Assertions.assertFalse(listMetricsResponse.metrics().isEmpty(), "No ApiCallDuration metric received by CloudWatch");

        } catch (InterruptedException | SdkException e) {
            LOGGER.error(e.getMessage(), e);
        } finally {
            greetingsSender.deleteTable();
            greetingsSender.close();
        }
    }