Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,17 @@ public void monthlyReport() {
logger.info("Fetching Metrics for EMR Clusters for monthly report");
List<EMRClusterMetricsVO> reportMetrics = emrClusterMetricsDao.getClusterMetricsReport(lastMonth, currentTime, "all");

logger.info("Fetching clusters close to rotation SLA for AMI rotation monthly report");
List<ClusterVO> clusters =
this.emrClusterMetadataDao.getAMIRotationReport("all").stream()
.filter(c -> c.getAMIRotationDaysToGo() < 7).collect(Collectors.toList());
logger.info("Picked up clusters close to rotation SLA for AMI rotation monthly report");

ReportBuilder builder = new ReportBuilder();

String report = builder.openHtmlTag()
.openBodyTag()
.appendAMIRotationReport(clusters, currentTime)
.appendMetricsReport(reportMetrics, lastMonth, currentTime)
.closeBodyTag()
.closeHtmlTag()
Expand All @@ -338,7 +345,6 @@ public void monthlyReport() {
String recipients = configHelper.getConfigValue("report_recipients");
emailUtil.sendEmail(report,subject, recipients.split(","));


}


Expand Down