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 2020/09/14 21:30:33 UTC

[GitHub] [nifi] YolandaMDavis commented on a change in pull request #4522: NIFI-7796: Add Prometheus counters for total bytes sent/received

YolandaMDavis commented on a change in pull request #4522:
URL: https://github.com/apache/nifi/pull/4522#discussion_r488230787



##########
File path: nifi-nar-bundles/nifi-extension-utils/nifi-prometheus-utils/src/main/java/org/apache/nifi/prometheus/util/PrometheusMetricsUtil.java
##########
@@ -249,10 +249,8 @@ public static CollectorRegistry createNifiMetrics(NiFiMetricsRegistry nifiMetric
                 nifiMetricsRegistry.setDataPoint(portStatus.getBytesSent(), "AMOUNT_BYTES_SENT", instanceId, portComponentType, portComponentName, portComponentId, parentId);
                 nifiMetricsRegistry.setDataPoint(portStatus.getInputBytes(), "AMOUNT_BYTES_READ", instanceId, portComponentType, portComponentName, portComponentId, parentId);
                 nifiMetricsRegistry.setDataPoint(portStatus.getOutputBytes(), "AMOUNT_BYTES_WRITTEN", instanceId, portComponentType, portComponentName, portComponentId, parentId);
-                nifiMetricsRegistry.incrementCounter(status.getBytesRead(), "TOTAL_BYTES_READ", instanceId, portComponentType, portComponentName, portComponentId, parentId);
-                nifiMetricsRegistry.incrementCounter(status.getBytesWritten(), "TOTAL_BYTES_WRITTEN", instanceId, portComponentType, portComponentName, portComponentId, parentId);
-                nifiMetricsRegistry.incrementCounter(status.getBytesReceived(), "TOTAL_BYTES_RECEIVED", instanceId, portComponentType, portComponentName, portComponentId, parentId);
-                nifiMetricsRegistry.incrementCounter(status.getBytesSent(), "TOTAL_BYTES_SENT", instanceId, portComponentType, portComponentName, portComponentId, parentId);
+                nifiMetricsRegistry.incrementCounter(portStatus.getBytesReceived(), "TOTAL_BYTES_RECEIVED", instanceId, portComponentType, portComponentName, portComponentId, parentId);
+                nifiMetricsRegistry.incrementCounter(portStatus.getBytesSent(), "TOTAL_BYTES_SENT", instanceId, portComponentType, portComponentName, portComponentId, parentId);

Review comment:
       @mattyb149 in this instance we'll need to keep the TOTAL_BYTES_READ and TOTAL_BYTES_WRITTEN (lines previously on 252 and 253 however the portStatus.getInputBytes() and portStatus.getOutputBytes() should be used respectively as in lines 250 and 251

##########
File path: nifi-nar-bundles/nifi-extension-utils/nifi-prometheus-utils/src/main/java/org/apache/nifi/prometheus/util/PrometheusMetricsUtil.java
##########
@@ -277,10 +275,8 @@ public static CollectorRegistry createNifiMetrics(NiFiMetricsRegistry nifiMetric
                 nifiMetricsRegistry.setDataPoint(portStatus.getBytesSent(), "AMOUNT_BYTES_SENT", instanceId, portComponentType, portComponentName, portComponentId, parentId);
                 nifiMetricsRegistry.setDataPoint(portStatus.getInputBytes(), "AMOUNT_BYTES_READ", instanceId, portComponentType, portComponentName, portComponentId, parentId);
                 nifiMetricsRegistry.setDataPoint(portStatus.getOutputBytes(), "AMOUNT_BYTES_WRITTEN", instanceId, portComponentType, portComponentName, portComponentId, parentId);
-                nifiMetricsRegistry.incrementCounter(status.getBytesRead(), "TOTAL_BYTES_READ", instanceId, portComponentType, portComponentName, portComponentId, parentId);
-                nifiMetricsRegistry.incrementCounter(status.getBytesWritten(), "TOTAL_BYTES_WRITTEN", instanceId, portComponentType, portComponentName, portComponentId, parentId);
-                nifiMetricsRegistry.incrementCounter(status.getBytesReceived(), "TOTAL_BYTES_RECEIVED", instanceId, portComponentType, portComponentName, portComponentId, parentId);

Review comment:
       same as comment above




----------------------------------------------------------------
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.

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