code: private Map<String,Object> getSeverityMetrics(AppdynamicsApplication application, String instanceUrl ) {
  
          long responseTimeSeverity = 0;
          long errorRateSeverity = 0;
  
          Map<String,Object> severityMetrics = new HashMap<>();
  
          try {
              // NUMBER OF VIOLATIONS
              String url = joinURL(instanceUrl, String.format(HEALTH_VIOLATIONS_PATH, application.getAppID()));
              ResponseEntity<String> responseEntity = makeRestCall(url);
              String returnJSON = responseEntity.getBody();
              JSONParser parser = new JSONParser();
  
              JSONArray array = (JSONArray) parser.parse(returnJSON);
  
              for (Object entry : array) {
                  JSONObject jsonEntry = (JSONObject) entry;
                  JSONObject affEntityObj = (JSONObject) jsonEntry.get("affectedEntityDefinition");
  
                  String entityType = getString(affEntityObj, "entityType");
  
  
                  if (entityType.equals(BUSINESS_TRANSACTION)) {
  
                      long severity = getString(jsonEntry, "severity").equals("CRITICAL") ? 2 : 1;
  
                      if (getString(jsonEntry, "name").equals("Business Transaction error rate is much higher than normal")) {
                          errorRateSeverity = Math.max(errorRateSeverity, severity);
                      } else if (getString(jsonEntry, "name").equals("Business Transaction response time is much higher than normal")) {
                          responseTimeSeverity = Math.max(responseTimeSeverity, severity);
                      }
                  }
              }
          } catch (MalformedURLException e) {
              LOG.error("client exception loading applications", e);
          } catch (ParseException e) {
              LOG.error("client exception loading applications", e);
          }
          severityMetrics.put(ERROR_RATE_SEVERITY,errorRateSeverity);
          severityMetrics.put(RESPONSE_TIME_SEVERITY,responseTimeSeverity);
          return severityMetrics;
      }
docs: Calculates the response time and error rate severities.
  0: good, 1: warning, 2: critical
  Iterates through list of violations. The final severity will be the highest of them all
  (e.g. response time violations are Warning, Critical, Warning, Warning, Warning -> Critical)
  
  @param application the current application. Used to provide access to appID/name
  @return List of two PerformanceMetrics that contain info about the severities