Skip to content

Automated fix for refs/heads/update-prometheus #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: update-prometheus
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tools/run_tests/performance/prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import json
import logging
import statistics
import time
from typing import Any, Dict, List

from dateutil import parser
Expand Down Expand Up @@ -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:
Expand All @@ -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)
Expand Down