class AssetGroupStatsCollector implements Constants {

    public void uploadAssetGroupIssues(Map<String, List<String>> assetGroups) throws Exception {
        log.info("    Start Collecing  issues");
        List<Map<String, Object>> docs = new ArrayList<>();
        assetGroups.entrySet().stream().forEach(entry -> {
            String ag = entry.getKey();
            List<String> domains = entry.getValue();
            try {
                List<Map<String, Object>> docList = AssetGroupUtil.fetchIssuesInfo(COMP_API_URL, ag, domains,getToken());
                docList.parallelStream().forEach(doc -> {
                    doc.put("ag", ag);
                    doc.put("date", CURR_DATE);
                    doc.put("@id", Util.getUniqueID(ag + doc.get(DOMAIN) + CURR_DATE));
                });
                docs.addAll(docList);
            } catch (Exception e) {
                log.error("Exception in uploadAssetGroupIssues" , e);
                Map<String,String> errorMap = new HashMap<>();
                errorMap.put(ERROR, "Exception in uploadAssetGroupIssues for Asset Group"+ag);
                errorMap.put(ERROR_TYPE, WARN);
                errorMap.put(EXCEPTION, e.getMessage());
                synchronized(errorList){
                    errorList.add(errorMap);
                }
            }
        });
        ESManager.uploadData(AG_STATS, "issues", docs, "@id", false);
        log.info("    End Collecing  issues");
    }

}