akshayrai commented on a change in pull request #4495: [TE] [Composite-Alert] 
Adding Entity GroupKey with Whitelist Template and Formatter
URL: https://github.com/apache/incubator-pinot/pull/4495#discussion_r311229256
 
 

 ##########
 File path: 
thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/alert/content/EntityGroupKeyContentFormatter.java
 ##########
 @@ -93,29 +110,51 @@ protected void 
updateTemplateDataByAnomalyResults(Map<String, Object> templateDa
     for (String entityName : entityToAnomaliesMap.keySet()) {
       List<AnomalyReportEntity> groupedAnomalies = (List<AnomalyReportEntity>) 
entityToAnomaliesMap.get(entityName);
       groupedAnomalies.sort((u1, u2) -> 
anomalyToGroupScoreMap.get(u2).compareTo(anomalyToGroupScoreMap.get(u1)));
-      entityToSortedAnomaliesMap.put(entityName, groupedAnomalies);
+      entityToSortedAnomaliesMap.putAll(entityName, groupedAnomalies);
     }
 
+    // Insert anomaly snapshot image
+    if (whitelistMetricToAnomaliesMap.size() == 1 && 
whitelistMetricToAnomaliesMap.values().size() == 1) {
 
 Review comment:
   Actually, this condition here is to display the graph when we have only one 
anomaly. Otherwise, we will list all the anomalies. This map is passed below in 
line no. 127 which is then processed in the freemarker template file.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to