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


##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/prometheusutil/NiFiMetricsRegistry.java:
##########
@@ -275,5 +275,35 @@ public NiFiMetricsRegistry() {
                 .help("Provenance repository free space in bytes")
                 .labelNames("instance", "component_type", "component_name", 
"component_id", "parent_id", "repo_identifier")
                 .register(registry));
+
+        nameToGaugeMap.put("PROCESSING_PERF_CPU_MILLIS", Gauge.build()

Review Comment:
   ```suggestion
           nameToGaugeMap.put("PROCESSING_PERFORMANCE_CPU_DURATION", 
Gauge.build()
   ```



##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/prometheusutil/NiFiMetricsRegistry.java:
##########
@@ -275,5 +275,35 @@ public NiFiMetricsRegistry() {
                 .help("Provenance repository free space in bytes")
                 .labelNames("instance", "component_type", "component_name", 
"component_id", "parent_id", "repo_identifier")
                 .register(registry));
+
+        nameToGaugeMap.put("PROCESSING_PERF_CPU_MILLIS", Gauge.build()
+                .name("nifi_processing_performance_cpu_duration")
+                .help("Estimated CPU time (in milliseconds) used by this 
component")
+                .labelNames("instance", "component_type", "component_name", 
"component_id", "parent_id", "repo_identifier")
+                .register(registry));
+
+        nameToGaugeMap.put("PROCESSING_PERF_GC_MILLIS", Gauge.build()

Review Comment:
   ```suggestion
           nameToGaugeMap.put("PROCESSING_PERFORMANCE_GC_DURATION", 
Gauge.build()
   ```



##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/prometheusutil/PrometheusMetricsUtil.java:
##########
@@ -508,4 +518,25 @@ private static void addStorageUsageMetric(final 
NiFiMetricsRegistry nifiMetricsR
         nifiMetricsRegistry.setDataPoint(storageUsage.getUsedSpace(), 
usedSpaceLabel,
                 instanceId, componentType, componentName, componentId, 
parentId, storageUsage.getIdentifier());
     }
+
+    private static void addProcessingPerformanceMetrics(final 
NiFiMetricsRegistry niFiMetricsRegistry, final ProcessingPerformanceStatus 
perfStatus, final String instanceId,
+                                                        final String 
componentType, final String componentName, final String componentId, final 
String parentId) {
+        if (perfStatus != null) {
+            niFiMetricsRegistry.setDataPoint(perfStatus.getCpuDuration() / 
1000.0, "PROCESSING_PERF_CPU_MILLIS",
+                    instanceId, componentType, componentName, componentId, 
parentId, perfStatus.getIdentifier());
+
+            // Base metric already in milliseconds
+            
niFiMetricsRegistry.setDataPoint(perfStatus.getGarbageCollectionDuration(), 
"PROCESSING_PERF_GC_MILLIS",
+                    instanceId, componentType, componentName, componentId, 
parentId, perfStatus.getIdentifier());
+
+            
niFiMetricsRegistry.setDataPoint(perfStatus.getContentReadDuration() / 1000.0, 
"PROCESSING_PERF_READ_MILLIS",
+                    instanceId, componentType, componentName, componentId, 
parentId, perfStatus.getIdentifier());
+
+            
niFiMetricsRegistry.setDataPoint(perfStatus.getContentWriteDuration() / 1000.0, 
"PROCESSING_PERF_WRITE_MILLIS",
+                    instanceId, componentType, componentName, componentId, 
parentId, perfStatus.getIdentifier());
+
+            
niFiMetricsRegistry.setDataPoint(perfStatus.getSessionCommitDuration() / 
1000.0, "PROCESSING_PERF_COMMIT_MILLIS",
+                    instanceId, componentType, componentName, componentId, 
parentId, perfStatus.getIdentifier());

Review Comment:
   The `PROCESSING_PERF` references should be updated to align with the 
recommendations in the Metrics Registry.



##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/prometheusutil/NiFiMetricsRegistry.java:
##########
@@ -275,5 +275,35 @@ public NiFiMetricsRegistry() {
                 .help("Provenance repository free space in bytes")
                 .labelNames("instance", "component_type", "component_name", 
"component_id", "parent_id", "repo_identifier")
                 .register(registry));
+
+        nameToGaugeMap.put("PROCESSING_PERF_CPU_MILLIS", Gauge.build()
+                .name("nifi_processing_performance_cpu_duration")
+                .help("Estimated CPU time (in milliseconds) used by this 
component")
+                .labelNames("instance", "component_type", "component_name", 
"component_id", "parent_id", "repo_identifier")
+                .register(registry));
+
+        nameToGaugeMap.put("PROCESSING_PERF_GC_MILLIS", Gauge.build()
+                .name("nifi_processing_performance_gc_duration")
+                .help("Estimated garbage collection time (in milliseconds) 
used by this component")
+                .labelNames("instance", "component_type", "component_name", 
"component_id", "parent_id", "repo_identifier")
+                .register(registry));
+
+        nameToGaugeMap.put("PROCESSING_PERF_READ_MILLIS", Gauge.build()

Review Comment:
   ```suggestion
           nameToGaugeMap.put("PROCESSING_PERFORMANCE_CONTENT_READ_DURATION", 
Gauge.build()
   ```



##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/prometheusutil/NiFiMetricsRegistry.java:
##########
@@ -275,5 +275,35 @@ public NiFiMetricsRegistry() {
                 .help("Provenance repository free space in bytes")
                 .labelNames("instance", "component_type", "component_name", 
"component_id", "parent_id", "repo_identifier")
                 .register(registry));
+
+        nameToGaugeMap.put("PROCESSING_PERF_CPU_MILLIS", Gauge.build()
+                .name("nifi_processing_performance_cpu_duration")
+                .help("Estimated CPU time (in milliseconds) used by this 
component")
+                .labelNames("instance", "component_type", "component_name", 
"component_id", "parent_id", "repo_identifier")
+                .register(registry));
+
+        nameToGaugeMap.put("PROCESSING_PERF_GC_MILLIS", Gauge.build()
+                .name("nifi_processing_performance_gc_duration")
+                .help("Estimated garbage collection time (in milliseconds) 
used by this component")
+                .labelNames("instance", "component_type", "component_name", 
"component_id", "parent_id", "repo_identifier")
+                .register(registry));
+
+        nameToGaugeMap.put("PROCESSING_PERF_READ_MILLIS", Gauge.build()
+                .name("nifi_processing_performance_content_read_duration")
+                .help("Estimated content read time (in milliseconds) used by 
this component")
+                .labelNames("instance", "component_type", "component_name", 
"component_id", "parent_id", "repo_identifier")
+                .register(registry));
+
+        nameToGaugeMap.put("PROCESSING_PERF_WRITE_MILLIS", Gauge.build()

Review Comment:
   ```suggestion
           nameToGaugeMap.put("PROCESSING_PERFORMANCE_CONTENT_WRITE_DURATION", 
Gauge.build()
   ```



##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/prometheusutil/NiFiMetricsRegistry.java:
##########
@@ -275,5 +275,35 @@ public NiFiMetricsRegistry() {
                 .help("Provenance repository free space in bytes")
                 .labelNames("instance", "component_type", "component_name", 
"component_id", "parent_id", "repo_identifier")
                 .register(registry));
+
+        nameToGaugeMap.put("PROCESSING_PERF_CPU_MILLIS", Gauge.build()
+                .name("nifi_processing_performance_cpu_duration")
+                .help("Estimated CPU time (in milliseconds) used by this 
component")
+                .labelNames("instance", "component_type", "component_name", 
"component_id", "parent_id", "repo_identifier")
+                .register(registry));
+
+        nameToGaugeMap.put("PROCESSING_PERF_GC_MILLIS", Gauge.build()
+                .name("nifi_processing_performance_gc_duration")
+                .help("Estimated garbage collection time (in milliseconds) 
used by this component")
+                .labelNames("instance", "component_type", "component_name", 
"component_id", "parent_id", "repo_identifier")
+                .register(registry));
+
+        nameToGaugeMap.put("PROCESSING_PERF_READ_MILLIS", Gauge.build()
+                .name("nifi_processing_performance_content_read_duration")
+                .help("Estimated content read time (in milliseconds) used by 
this component")
+                .labelNames("instance", "component_type", "component_name", 
"component_id", "parent_id", "repo_identifier")
+                .register(registry));
+
+        nameToGaugeMap.put("PROCESSING_PERF_WRITE_MILLIS", Gauge.build()
+                .name("nifi_processing_performance_content_write_duration")
+                .help("Estimated content write time (in milliseconds) used by 
this component")
+                .labelNames("instance", "component_type", "component_name", 
"component_id", "parent_id", "repo_identifier")
+                .register(registry));
+
+        nameToGaugeMap.put("PROCESSING_PERF_COMMIT_MILLIS", Gauge.build()

Review Comment:
   ```suggestion
           nameToGaugeMap.put("PROCESSING_PERFORMANCE_SESSION_COMMIT_DURATION", 
Gauge.build()
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to