Skip to content

Commit

Permalink
speccpu updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sousinha1997 committed Oct 1, 2024
1 parent b1361a7 commit c35b138
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 8 deletions.
54 changes: 50 additions & 4 deletions quisby/benchmarks/speccpu/comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,35 @@
create_sheet, clear_sheet_data, clear_sheet_charts,
)
from quisby.util import combine_two_array_alternating
from quisby.util import combine_two_array_alternating, merge_lists_alternately, read_config
from quisby.benchmarks.coremark.graph import graph_coremark_data
import re

def extract_prefix_and_number(input_string):
match = re.search(r'^(.*?)(\d+)(.*?)$', input_string)
if match:
prefix = match.group(1)
suffix = match.group(3) # Extracts the suffix after the number
return prefix, suffix
return None, None


def compare_inst(item1, item2):
cloud_type = read_config("cloud", "cloud_type")
if cloud_type == "local":
return True
elif cloud_type == "aws":
return item1.split(".")[0] == item2.split(".")[0]
elif cloud_type == "gcp":

return item1.split("-")[0] == item2.split("-")[0]
elif cloud_type == "azure":
return extract_prefix_and_number(item1) == extract_prefix_and_number(item2)

def compare_speccpu_results(spreadsheets, spreadsheetId, test_name):
spreadsheet_name = []
values = []
table_name = ["System name", "Price-perf"]
results = []
test_name = "speccpu"

Expand All @@ -28,11 +52,33 @@ def compare_speccpu_results(spreadsheets, spreadsheetId, test_name):
list_2 = list(values[1])

for value in list_1:
results.append([""])
for ele in list_2:
if value[0][0] == ele[0][0] and value[0][1] == ele[0][1]:
results.append(value[0])
results = combine_two_array_alternating(results, value, ele)
# Check max throughput
if value[0][0] in table_name and ele[0][0] in table_name and value[0][0] == ele[0][0]:
if compare_inst(value[1][0], ele[1][0]):
results.append([""])
for item1 in value:
for item2 in ele:
if item1[0] == item2[0]:
results = merge_lists_alternately(results, item1, item2)
break

elif value[0][0] == "Cost/Hr" and ele[0][0] == "Cost/Hr":
if compare_inst(value[1][0], ele[1][0]):
results.append([""])
for item1 in value:
for item2 in ele:
if item1[0] == item2[0]:
results.append(item1)
break

elif value[1][0] == ele[1][0]:
if value[0][0] == ele[0][0]:
results.append([""])
results.append(value[0])
for item1, item2 in zip(value[1:], ele[1:]):
results = merge_lists_alternately(results, item1, item2)
break
try:
create_sheet(spreadsheetId, test_name)
custom_logger.info("Deleting existing charts and data from the sheet...")
Expand Down
8 changes: 4 additions & 4 deletions quisby/benchmarks/speccpu/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def create_series_range_speccpu_compare(column_count, sheetId, start_index, end_
"sources": [
{
"sheetId": sheetId,
"startRowIndex": start_index + 1,
"startRowIndex": start_index ,
"endRowIndex": end_index,
"startColumnIndex": 1,
"endColumnIndex": 2,
Expand All @@ -57,7 +57,7 @@ def create_series_range_speccpu_compare(column_count, sheetId, start_index, end_
"sources": [
{
"sheetId": sheetId,
"startRowIndex": start_index + 1,
"startRowIndex": start_index ,
"endRowIndex": end_index,
"startColumnIndex": 2,
"endColumnIndex": 3,
Expand All @@ -74,7 +74,7 @@ def create_series_range_speccpu_compare(column_count, sheetId, start_index, end_
"sources": [
{
"sheetId": sheetId,
"startRowIndex": start_index + 1,
"startRowIndex": start_index ,
"endRowIndex": end_index,
"startColumnIndex": 3,
"endColumnIndex": 4,
Expand Down Expand Up @@ -112,7 +112,7 @@ def graph_speccpu_data(spreadsheetId, test_name, action):
start_index = index
test = data[start_index][0]
title = "%s : %s" % (test_name, "Price-Performance")
subtitle = "%s : %s" % ("Geomean/$", test)
subtitle = "%s :" % (row[1].split("-")[0])
left_title = row[1].lower()

if start_index:
Expand Down

0 comments on commit c35b138

Please sign in to comment.