rmatharu commented on a change in pull request #1083: SAMZA-2251: Minor 
diagnostics manager change to emit additional job details
URL: https://github.com/apache/samza/pull/1083#discussion_r296361245
 
 

 ##########
 File path: 
samza-core/src/main/scala/org/apache/samza/diagnostics/DiagnosticsManager.java
 ##########
 @@ -141,36 +171,83 @@ public void addExceptionEvent(DiagnosticsExceptionEvent 
diagnosticsExceptionEven
     this.exceptions.add(diagnosticsExceptionEvent);
   }
 
+  public void addProcessorStopEvent(String processorId, String resourceId, 
String host, int exitStatus) {
+    this.containerStops.add(new ProcessorStopEvent(processorId, resourceId, 
host, exitStatus));
+    LOG.info("Added stop event for Container Id: {}, resource Id: {}, host: 
{}, exitStatus: {}", processorId,
+        resourceId, host, exitStatus);
+  }
+
   private class DiagnosticsStreamPublisher implements Runnable {
 
     @Override
     public void run() {
+
+      Map<String, Map<String, Object>> metricsMessage = new HashMap<>();
+
+      // Publish job-related params (if not already published)
+      if (!jobParamsEmitted) {
+        metricsMessage.putIfAbsent(GROUP_NAME_FOR_DIAGNOSTICS_MANAGER, new 
HashMap<>());
+        
metricsMessage.get(GROUP_NAME_FOR_DIAGNOSTICS_MANAGER).put(CONTAINER_COUNT_METRIC_NAME,
 containerCount);
 
 Review comment:
   yes, since messages from container and AM can arrive in any order
   publishing from both made the read logic simple
   Since its only published once per container, i didn't think there was 
significant overhead.

----------------------------------------------------------------
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

Reply via email to