code: private Double fetchDeploySuccessRatio(ObjectId collectorItemId) {
      int totalDeploys = 0, totalDeploySuccess = 0;
      Double deploySuccessScore = null;
  
      List<EnvironmentComponent> components = environmentComponentRepository
        .findByCollectorItemId(collectorItemId);
  
      if (null == components || components.isEmpty()) {
        return null;
      }
  
      for (EnvironmentComponent environmentComponent : components) {
        totalDeploys++;
        if (environmentComponent.isDeployed()) {
          totalDeploySuccess++;
        }
      }
      deploySuccessScore = ((totalDeploySuccess * 100) / (double) totalDeploys);
      LOGGER.info("totalDeploys " + totalDeploys + " totalDeploySuccess " + totalDeploySuccess + " deploySuccessScore " + deploySuccessScore);
  
      return deploySuccessScore;
    }
docs: Calculate percentage of successfully deployed components
  
  @param collectorItemId Collector Item Id of deploy
  @return percentage of deployed components