@@ -54,9 +54,19 @@ def extract_redis_configuration_from_topology(topologies_map, topology_spec_name
54
54
55
55
56
56
def extract_client_cpu_limit (benchmark_config ):
57
- db_cpu_limit = benchmark_config ["clientconfig" ]["resources" ]["requests" ]["cpus" ]
58
- ceil_db_cpu_limit = math .ceil (float (db_cpu_limit ))
59
- return ceil_db_cpu_limit
57
+ # Handle both clientconfig (single) and clientconfigs (multiple) formats
58
+ if "clientconfigs" in benchmark_config :
59
+ # For multiple configs, return the sum of all CPU limits
60
+ total_cpu_limit = 0
61
+ for client_config in benchmark_config ["clientconfigs" ]:
62
+ cpu_limit = client_config ["resources" ]["requests" ]["cpus" ]
63
+ total_cpu_limit += float (cpu_limit )
64
+ return math .ceil (total_cpu_limit )
65
+ else :
66
+ # Legacy single clientconfig format
67
+ db_cpu_limit = benchmark_config ["clientconfig" ]["resources" ]["requests" ]["cpus" ]
68
+ ceil_db_cpu_limit = math .ceil (float (db_cpu_limit ))
69
+ return ceil_db_cpu_limit
60
70
61
71
62
72
def extract_build_variant_variations (benchmark_config , keyname = "build-variants" ):
@@ -74,9 +84,60 @@ def extract_client_container_image(benchmark_config, keyname="clientconfig"):
74
84
return client_container_image
75
85
76
86
87
+ def extract_client_container_images (benchmark_config ):
88
+ """Extract container images for both single and multiple client configs"""
89
+ if "clientconfigs" in benchmark_config :
90
+ # Multiple client configs - return list of images
91
+ images = []
92
+ for client_config in benchmark_config ["clientconfigs" ]:
93
+ if "run_image" in client_config :
94
+ images .append (client_config ["run_image" ])
95
+ else :
96
+ images .append (None )
97
+ return images
98
+ elif "clientconfig" in benchmark_config :
99
+ # Single client config - return list with one image for consistency
100
+ if "run_image" in benchmark_config ["clientconfig" ]:
101
+ return [benchmark_config ["clientconfig" ]["run_image" ]]
102
+ else :
103
+ return [None ]
104
+ return []
105
+
106
+
77
107
def extract_client_tool (benchmark_config , keyname = "clientconfig" ):
78
108
client_tool = None
79
109
if keyname in benchmark_config :
80
110
if "tool" in benchmark_config [keyname ]:
81
111
client_tool = benchmark_config [keyname ]["tool" ]
82
112
return client_tool
113
+
114
+
115
+ def extract_client_tools (benchmark_config ):
116
+ """Extract tools for both single and multiple client configs"""
117
+ if "clientconfigs" in benchmark_config :
118
+ # Multiple client configs - return list of tools
119
+ tools = []
120
+ for client_config in benchmark_config ["clientconfigs" ]:
121
+ if "tool" in client_config :
122
+ tools .append (client_config ["tool" ])
123
+ else :
124
+ tools .append (None )
125
+ return tools
126
+ elif "clientconfig" in benchmark_config :
127
+ # Single client config - return list with one tool for consistency
128
+ if "tool" in benchmark_config ["clientconfig" ]:
129
+ return [benchmark_config ["clientconfig" ]["tool" ]]
130
+ else :
131
+ return [None ]
132
+ return []
133
+
134
+
135
+ def extract_client_configs (benchmark_config ):
136
+ """Extract client configurations as a list for both single and multiple formats"""
137
+ if "clientconfigs" in benchmark_config :
138
+ # Multiple client configs
139
+ return benchmark_config ["clientconfigs" ]
140
+ elif "clientconfig" in benchmark_config :
141
+ # Single client config - return as list for consistency
142
+ return [benchmark_config ["clientconfig" ]]
143
+ return []
0 commit comments