Skip to content

Commit cf9cd78

Browse files
committed
Add query delay flag to Prometheus query script.
This PR adds the flag allows user to config the delay of querying the Prometheus.
1 parent 58b298f commit cf9cd78

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tools/run_tests/performance/prometheus.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import json
3232
import logging
3333
import statistics
34+
import time
3435
from typing import Any, Dict, List
3536

3637
from dateutil import parser
@@ -269,6 +270,12 @@ def main() -> None:
269270
default=False,
270271
help='Suppress informative output',
271272
)
273+
argp.add_argument(
274+
'--delay_seconds',
275+
default=0,
276+
type=int,
277+
help='Configure delay in seconds to perform Prometheus queries, default is 0s',
278+
)
272279
args = argp.parse_args()
273280

274281
if not args.quiet:
@@ -285,6 +292,8 @@ def main() -> None:
285292
end=end_time,
286293
)
287294

295+
time.sleep(args.delay_seconds)
296+
288297
pod_dict = construct_pod_dict(args.node_info_file, args.pod_type)
289298
processed_data = p.fetch_cpu_and_memory_data(
290299
container_list=args.container_name, pod_dict=pod_dict)

0 commit comments

Comments
 (0)