You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/06/24 00:03:59 UTC

[GitHub] [nifi] exceptionfactory commented on a diff in pull request #5905: NIFI-9817 Add a Validator for the PutCloudWatchMetric Processor's Unit Field

exceptionfactory commented on code in PR #5905:
URL: https://github.com/apache/nifi/pull/5905#discussion_r905603207


##########
nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/cloudwatch/PutCloudWatchMetric.java:
##########
@@ -70,6 +70,33 @@
     public static final Set<Relationship> relationships = Collections.unmodifiableSet(
             new HashSet<>(Arrays.asList(REL_SUCCESS, REL_FAILURE)));
 
+    private static final Set<String> units = Collections.unmodifiableSet(
+            new HashSet<>(Arrays.asList(
+                    "Seconds", "Microseconds", "Milliseconds", "Bytes",
+                    "Kilobytes", "Megabytes", "Gigabytes", "Terabytes",
+                    "Bits", "Kilobits", "Megabits", "Gigabits", "Terabits",
+                    "Percent", "Count", "Bytes/Second", "Kilobytes/Second",
+                    "Megabytes/Second", "Gigabytes/Second", "Terabytes/Second",
+                    "Bits/Second", "Kilobits/Second", "Megabits/Second",
+                    "Gigabits/Second", "Terabits/Second", "Count/Second",
+                    "None", "")));

Review Comment:
   Thanks for the reference @patalwell! Leveraging the enum values sounds like the optimal way forward.



-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org