diff --git a/tools/run_tests/performance/prometheus.py b/tools/run_tests/performance/prometheus.py index 810f318de9452..a083ac2ae74e0 100644 --- a/tools/run_tests/performance/prometheus.py +++ b/tools/run_tests/performance/prometheus.py @@ -31,6 +31,7 @@ import json import logging import statistics +import time from typing import Any, Dict, List from dateutil import parser @@ -269,6 +270,13 @@ def main() -> None: default=False, help='Suppress informative output', ) + argp.add_argument( + '--delay_seconds', + default=20, + type=int, + help= + 'Configure delay in seconds to perform Prometheus queries. The default value is 20s, this allows sufficient time for Prometheus to obtain data.', + ) args = argp.parse_args() if not args.quiet: @@ -285,6 +293,8 @@ def main() -> None: end=end_time, ) + time.sleep(args.delay_seconds) + pod_dict = construct_pod_dict(args.node_info_file, args.pod_type) processed_data = p.fetch_cpu_and_memory_data( container_list=args.container_name, pod_dict=pod_dict)