Skip to content

Commit

Permalink
implement #135, cat error out on missing configuraiton parameter (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexafshar authored Apr 2, 2024
1 parent 280f909 commit 5aa643e
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions backend/extractionSteps/maturityAssessment/apm/BackendsAPM.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,20 @@ def analyze(self, controllerData, thresholds):
analysisDataEvaluatedMetrics["percentBackendsWithLoad"] = 0

# backendLimitNotHit
backendLimit = int(
next(
iter([configuration for configuration in hostInfo["configurations"] if configuration["name"] == "backend.registration.limit"])
)["value"]
)
try:
backendLimit = int(
next(
iter([configuration for configuration in hostInfo["configurations"] if configuration["name"] == "backend.registration.limit"])
)["value"]
)
except StopIteration:
logging.warning(f'{hostInfo["controller"].host} - '
f'backend.registration.limit '
f'configuration not found for'
f' {application["name"]}. Use default.')
# set to default if api not returning
backendLimit = 500000

analysisDataEvaluatedMetrics["backendLimitNotHit"] = len(application["backends"]) <= backendLimit

# numberOfCustomBackendRules
Expand Down

0 comments on commit 5aa643e

Please sign in to comment.