Skip to content

Commit 5eb8c94

Browse files
juliayakovlevfruch
authored andcommitted
improvement(performance): add support for user profile in HDR analysis
This commit introduces two changes to enable user profile support in performance testing: Set the HDR tag according to the stress command when using a user profile. Currently, only standard operations (read and insert) are supported for user-profile-based stress commands. The HDR tag for stress commands with a user profile is now written in lowercase. The tag validation logic has been updated to perform a case-insensitive comparison. (cherry picked from commit 2df90d9)
1 parent b87f7c3 commit 5eb8c94

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

sdcm/stress_thread.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,26 @@ def set_stress_operation(self, stress_cmd):
107107
def set_hdr_tags(self, stress_cmd):
108108
# TODO: add support for the "counter_write", "counter_read" and "user" modes?
109109
params = get_stress_cmd_params(stress_cmd)
110-
if "fixed threads" in params:
111-
if " mixed " in stress_cmd:
112-
self.hdr_tags = ["WRITE-rt", "READ-rt"]
113-
elif " read " in stress_cmd:
114-
self.hdr_tags = ["READ-rt"]
110+
tag_suffix = "rt" if "fixed threads" in params else "st"
111+
if "user profile=" in stress_cmd:
112+
# Examples:
113+
# Write: ops(insert=1)
114+
# Read: ops(read=2)
115+
# Mixed: ops(insert=1,read=2)
116+
# Only standard operations (read and insert) are supported per user profile stress command in this implementation
117+
if "insert=" in stress_cmd:
118+
self.hdr_tags.append(f"WRITE-{tag_suffix}")
119+
elif "read=" in stress_cmd:
120+
self.hdr_tags.append(f"READ-{tag_suffix}")
115121
else:
116-
self.hdr_tags = ["WRITE-rt"]
122+
raise ValueError(
123+
"Cannot detect supported stress operation type from the stress command with user profile: %s", stress_cmd)
117124
elif " mixed " in stress_cmd:
118-
self.hdr_tags = ["WRITE-st", "READ-st"]
125+
self.hdr_tags = [f"WRITE-{tag_suffix}", f"READ-{tag_suffix}"]
119126
elif " read " in stress_cmd:
120-
self.hdr_tags = ["READ-st"]
127+
self.hdr_tags = [f"READ-{tag_suffix}"]
121128
else:
122-
self.hdr_tags = ["WRITE-st"]
129+
self.hdr_tags = [f"WRITE-{tag_suffix}"]
123130

124131
@staticmethod
125132
def append_no_warmup_to_cmd(stress_cmd):

sdcm/utils/hdrhistogram.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,9 @@ def analyze_hdr_file():
260260
line_index = 5
261261
while next_hist:
262262
tag = next_hist.get_tag()
263-
if tag == hdr_tag:
263+
# The tag in the HDR file for the stress command with the user profile is in lowercase.
264+
# Modify the tag validation to perform a case-insensitive comparison.
265+
if tag.lower() == hdr_tag.lower():
264266
if tag_not_found:
265267
LOGGER.debug(f'found histogram entry with tag {hdr_tag} in file {hdr_file}')
266268
if histogram.get_start_time_stamp() == 0:

0 commit comments

Comments
 (0)