Skip to content
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

done #87, #125 #137

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
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
30 changes: 19 additions & 11 deletions backend/extractionSteps/JobStepBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,39 @@ def reportData(
return

rawDataHeaders = list(list(controllerData.values())[0][self.componentType].values())[0][jobStepName][metricFolder].keys()
writeUncoloredRow(rawDataSheet, 1, ["controller", "application", *rawDataHeaders])
headers = ["controller", "application"] + (["description"] if self.componentType == "apm" else []) + list(rawDataHeaders)

writeUncoloredRow(rawDataSheet, 1, headers)

# Write Data
rowIdx = 2
for host, hostInfo in controllerData.items():
for application in hostInfo[self.componentType].values():
if colorRows:
data = [
( hostInfo["controller"].host, None),
( application["name"], None),
*[application[jobStepName][metricFolder][header] for header in rawDataHeaders]
]
if self.componentType == "apm":
data.insert(2, ( application["description"], None))
writeColoredRow(
rawDataSheet,
rowIdx,
[
(hostInfo["controller"].host, None),
(application["name"], None),
*[application[jobStepName][metricFolder][header] for header in rawDataHeaders],
],
data
)
else:
data = [
hostInfo["controller"].host,
application["name"],
*[application[jobStepName][metricFolder][header] for header in rawDataHeaders]
]
if self.componentType == "apm":
data.insert(2, application["description"])
writeUncoloredRow(
rawDataSheet,
rowIdx,
[
hostInfo["controller"].host,
application["name"],
*[application[jobStepName][metricFolder][header] for header in rawDataHeaders],
],
data
)
rowIdx += 1

Expand Down
10 changes: 6 additions & 4 deletions backend/output/presentations/cxPptFsoUseCases.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,12 @@ class ExcelSheets(object):
def __init__(self, directory: str, filenames: tuple):
self.workbooks = {}
for filename in filenames:
full_path = os.path.join(directory, filename)
self.workbooks[filename] = pd.read_excel(full_path, sheet_name=None)
try:
full_path = os.path.join(directory, filename)
self.workbooks[filename] = pd.read_excel(full_path, sheet_name=None)
except Exception as e:
logging.warning(f"Not able to load workbook {filename}")
logging.warning(f"Was it generated to begin with? Ignoring.")

def findSheetByHeader(self, header_name):
result = []
Expand Down Expand Up @@ -539,8 +543,6 @@ def createCxHamUseCasePpt(folder: str):
f"{file_prefix}-Synthetics.xlsx"
))

assert len(excels.getWorkBooks()) == 11

# currently only 1st controller in the job file is examined.
controller = getValuesInColumn(apm_wb["Analysis"], "controller")[0]

Expand Down
35 changes: 23 additions & 12 deletions backend/output/reports/MaturityAssessmentReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,41 @@ def createWorkbook(self, jobs, controllerData, jobFileName):
jobNameCols.append(name if not name.startswith("OverallAssessment") else "OverallAssessment")
jobStep.reportData(workbook, controllerData, name)

data_header = [
"controller",
"componentType",
"name",
*jobNameCols,
]

if reportType == "apm": # add desc header after name
data_header.insert(3, "description")

# Write Headers
writeUncoloredRow(
analysisSheet,
1,
[
"controller",
"componentType",
"name",
*jobNameCols,
],
data_header
)

rowIdx = 2
for host, hostInfo in controllerData.items():
for component in hostInfo[reportType].values():

data_row = [
(hostInfo["controller"].host, None),
(reportType, None),
(component["name"], None),
*[component[jobStep]["computed"] for jobStep in [type(jobStep).__name__ for jobStep in filteredJobs]],
]

if reportType == "apm": # add desc after name
data_row.insert(3, (component["description"], None))

writeColoredRow(
analysisSheet,
rowIdx,
[
(hostInfo["controller"].host, None),
(reportType, None),
(component["name"], None),
*[component[jobStep]["computed"] for jobStep in [type(jobStep).__name__ for jobStep in filteredJobs]],
],
data_row
)
rowIdx += 1

Expand Down
Loading