-
Notifications
You must be signed in to change notification settings - Fork 300
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
Various changes to perf code #3037
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,4 @@ spec: | |
telemetry: | ||
enabled: true | ||
v2: | ||
enabled: true | ||
enabled: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,9 @@ def plotter(args): | |
|
||
df = pd.read_csv(args.csv_filepath) | ||
telemetry_modes_y_data = {} | ||
if not args.telemetry_modes: | ||
args.telemetry_modes = df["Labels"].unique() | ||
|
||
metric_name = get_metric_name(args) | ||
constructed_query_str = get_constructed_query_str(args) | ||
|
||
|
@@ -41,6 +44,8 @@ def plotter(args): | |
fig = plt.figure(figsize=(1138 / dpi, 871 / dpi), dpi=dpi) | ||
ax = fig.add_subplot(111) | ||
ax.set_ylim(0, 1.0) | ||
if args.title: | ||
ax.set_title(args.title) | ||
for key, val in telemetry_modes_y_data.items(): | ||
plot_key = key | ||
match key: | ||
|
@@ -107,15 +112,15 @@ def get_data_helper(df, query_list, query_str, telemetry_mode, metric_name): | |
try: | ||
data[metric_name].head().empty | ||
except KeyError as e: | ||
y_series_data.append(None) | ||
y_series_data.append(0) | ||
else: | ||
if not data[metric_name].head().empty: | ||
if metric_name.startswith('cpu') or metric_name.startswith('mem'): | ||
y_series_data.append(data[metric_name].head(1).values[0]) | ||
else: | ||
y_series_data.append(data[metric_name].head(1).values[0] / data["ActualQPS"].head(1).values[0]) | ||
y_series_data.append(data[metric_name].head(1).values[0] / 1000) | ||
else: | ||
y_series_data.append(None) | ||
y_series_data.append(0) | ||
|
||
return y_series_data | ||
|
||
|
@@ -174,15 +179,20 @@ def get_parser(): | |
parser.add_argument( | ||
"--query_str", | ||
help="Specify the qps or conn query_str that will be used to query your y-axis data based on the CSV file." | ||
"For example: conn_query_str=ActualQPS==1000, qps_query_str=NumThreads==16." | ||
"For example: conn_query_str=ActualQPS==1000, qps_query_str=NumThreads==16.", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure what that example is but if ActualQPS is from fortio json, it's very unlikely to be a nice exact round number - if you ask for 1000 you're likely to get 999.97 or some such There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think my formatter might have caught this. Having the hard equals isn't great, I agree. But it gets rounded to an int, so if you run it for long enough, the actual qps ends up being the desired qps (most of the time). |
||
default="" | ||
) | ||
parser.add_argument( | ||
"--csv_filepath", | ||
help="The path of the CSV file." | ||
) | ||
parser.add_argument( | ||
"--graph_title", | ||
help="The graph title." | ||
help="Output path." | ||
) | ||
parser.add_argument( | ||
"--title", | ||
help="Visual title of graph." | ||
) | ||
return parser | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: install.istio.io/v1alpha1 | ||
kind: IstioOperator | ||
spec: | ||
profile: ambient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why it was using data["ActualQPS"] before but maybe comment on the change?
(also fortio data, in the json files, is in seconds not ms (even if the UI shows in ms for human consumption) so not sure what the 1000 is for either?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some digging I think this is correct (but a comment would help). Fortio reports data in seconds, but the script that pull data from the fortio client converts it to microseconds
tools/perf/benchmark/runner/fortio.py
Lines 60 to 64 in 2030a1d
so I have to divide by 1000 to get it back to milliseconds