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/12/01 09:00:53 UTC

[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1456: MINIFICPP-1965 Add CMAKE flags to select malloc implementation

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


##########
docker/test/integration/minifi/core/DockerTestCluster.py:
##########
@@ -318,3 +318,25 @@ 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())
+        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)
+        print(f"Peak memory usage ({current_peak_memory_usage}) didnt exceed minimum asserted peak memory usage {minimum_peak_memory_usage}")

Review Comment:
   Good idea, I've changed it in https://github.com/apache/nifi-minifi-cpp/commit/c7b837f8f6bd5150c2e1de5c0ecf210df9a98225#diff-4487753f519234543da32b7926ab6cfc45c79ae2467eca71c8f6c269c7195eefR333



##########
docker/test/integration/minifi/core/DockerTestCluster.py:
##########
@@ -318,3 +318,25 @@ 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())
+        while (time.perf_counter() - start_time) < timeout_seconds:
+            if current_peak_memory_usage > minimum_peak_memory_usage:

Review Comment:
   Good idea, changed it in https://github.com/apache/nifi-minifi-cpp/commit/c7b837f8f6bd5150c2e1de5c0ecf210df9a98225#diff-4487753f519234543da32b7926ab6cfc45c79ae2467eca71c8f6c269c7195eefR325-R327



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