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

fixed report generation due to faulty response payload #141

Merged
merged 1 commit into from
Apr 26, 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
19 changes: 18 additions & 1 deletion backend/api/appd/AppDService.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,24 @@ async def getServers(self) -> Result:
response = await self.controller.getServersKeys(json.dumps(body))
serverKeys = await self.getResultFromResponse(response, debugString)

machineIds = [serverKey["machineId"] for serverKey in serverKeys.data["machineKeys"]]
machineIds = []
if not isinstance(serverKeys.data["machineKeys"], list):
logging.warning("Expected 'serverKeys.data[\"machineKeys\"]' to be a "
"list, but got {}".format(type(serverKeys.data["machineKeys"])))
else:
for serverKey in serverKeys.data["machineKeys"]:
if isinstance(serverKey, dict) and "machineId" in serverKey:
try:
machineIds.append(serverKey["machineId"])
except TypeError:
logging.warning("TypeError encountered with "
"machineId: {}".format(serverKey["machineId"]))
else:
if isinstance(serverKey, dict):
logging.warning("Dictionary lacks 'machineId' key: {}".format(serverKey))
else:
logging.warning("Expected a dictionary, but found type: {}".format(type(serverKey)))


serverFutures = [self.controller.getServer(serverId) for serverId in machineIds]
serversResponses = await AsyncioUtils.gatherWithConcurrency(*serverFutures)
Expand Down
4 changes: 3 additions & 1 deletion backend/output/presentations/cxPptFsoUseCases.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,9 @@ def cleanup_slides(root: Presentation, uc: UseCase):
def calculate_kpis(apm_wb, agent_wb, uc: UseCase):
# currently only supports one controller report out of the workbook
controller = getValuesInColumn(apm_wb["Analysis"], "controller")[0]
logging.info(f"processing report for 1st controller only as multiple controllers are not supported yet: {controller}")
logging.info(f"processing CX HAM Use Case report for 1st controller only "
f"as multiple "
f"controllers are not supported yet: {controller}")

totalApplications = getRowCountForController(apm_wb["Analysis"], controller)
percentAgentsReportingData = getValuesInColumnForController(apm_wb["AppAgentsAPM"], "percentAgentsReportingData", controller)
Expand Down
Loading