aldettinger commented on code in PR #4345: URL: https://github.com/apache/camel-quarkus/pull/4345#discussion_r1063419833
########## integration-test-groups/aws2/aws2-cw/src/test/java/org/apache/camel/quarkus/component/aws2/cw/it/Aws2CwTest.java: ########## @@ -90,4 +97,148 @@ public void metric() { } + @Test + public void headers() { + + final Instant startTime = Instant.ofEpochMilli(System.currentTimeMillis() - 10000); + + final String namespace = "cq-metrics-" + java.util.UUID.randomUUID().toString().replace("-", ""); + final String metricName = "metricName" + java.util.UUID.randomUUID().toString().replace("-", ""); + final int value = (int) (Math.random() * 10000); + + List<Map<String, String>> data = new LinkedList<>(); + + data.add(CollectionHelper.mapOf( + Cw2Constants.METRIC_NAMESPACE, namespace, + Cw2Constants.METRIC_NAME, metricName, + Cw2Constants.METRIC_VALUE, 2 * value, + Cw2Constants.METRIC_UNIT, "Count", + Cw2Constants.METRIC_DIMENSION_NAME, "type", + Cw2Constants.METRIC_DIMENSION_VALUE, "even")); + data.add(CollectionHelper.mapOf( + Cw2Constants.METRIC_NAMESPACE, namespace, + Cw2Constants.METRIC_NAME, metricName, + Cw2Constants.METRIC_VALUE, 2 * value + 2, + Cw2Constants.METRIC_UNIT, "Count", + Cw2Constants.METRIC_DIMENSIONS, "type=even")); + data.add(CollectionHelper.mapOf( + Cw2Constants.METRIC_NAMESPACE, namespace, + Cw2Constants.METRIC_NAME, metricName, + Cw2Constants.METRIC_VALUE, 2 * value + 4, + Cw2Constants.METRIC_UNIT, "Count", + Cw2Constants.METRIC_DIMENSION_NAME, "type", + Cw2Constants.METRIC_DIMENSION_VALUE, "even")); + + data.add(CollectionHelper.mapOf( + Cw2Constants.METRIC_NAMESPACE, namespace, + Cw2Constants.METRIC_NAME, metricName, + Cw2Constants.METRIC_VALUE, 2 * value + 1, + Cw2Constants.METRIC_UNIT, "Count", + Cw2Constants.METRIC_DIMENSION_NAME, "type", + Cw2Constants.METRIC_DIMENSION_VALUE, "odd")); + data.add(CollectionHelper.mapOf( + Cw2Constants.METRIC_NAMESPACE, namespace, Cw2Constants.METRIC_NAME, metricName, + Cw2Constants.METRIC_VALUE, 2 * value + 3, + Cw2Constants.METRIC_UNIT, "Count", + Cw2Constants.METRIC_DIMENSION_NAME, "type", + Cw2Constants.METRIC_DIMENSION_VALUE, "odd")); + // ignored because of timestamp + data.add(CollectionHelper.mapOf( + Cw2Constants.METRIC_NAMESPACE, namespace, Cw2Constants.METRIC_NAME, metricName, + Cw2Constants.METRIC_VALUE, 2 * value + 5, + Cw2Constants.METRIC_TIMESTAMP, System.currentTimeMillis() - 24 * 60 * 60 * 10000, Review Comment: `currentTimeMillis` unit is ms ? So, should we do 24h * 60 * 60s * 1000 instead of _10000_ ? One step further, couldn't we simply put a fixed value ? That way we avoid variation in test execution ? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org