martinzink commented on code in PR #1456:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1456#discussion_r1066965793


##########
docker/test/integration/minifi/core/DockerTestCluster.py:
##########
@@ -318,3 +318,31 @@ def wait_for_metric_class_on_prometheus(self, 
metric_class, timeout_seconds):
 
     def wait_for_processor_metric_on_prometheus(self, metric_class, 
timeout_seconds, processor_name):
         return 
PrometheusChecker().wait_for_processor_metric_on_prometheus(metric_class, 
timeout_seconds, processor_name)
+
+    def wait_for_peak_memory_usage(self, minimum_peak_memory_usage: int, 
timeout_seconds: int) -> bool:
+        start_time = time.perf_counter()
+        current_peak_memory_usage = get_peak_memory_usage(get_minifi_pid())
+        if current_peak_memory_usage is None:
+            logging.warning("Failed to determine peak memory usage")
+            return False
+        while (time.perf_counter() - start_time) < timeout_seconds:
+            if current_peak_memory_usage > minimum_peak_memory_usage:
+                return True
+            current_peak_memory_usage = get_peak_memory_usage(get_minifi_pid())
+            time.sleep(1)

Review Comment:
   good idea, I've changed it in 
https://github.com/apache/nifi-minifi-cpp/pull/1456/commits/d08d3c78709c3a1042429de7ac18591909f6e4d2#diff-4487753f519234543da32b7926ab6cfc45c79ae2467eca71c8f6c269c7195eefR325-R328



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