Crim commented on a change in pull request #3312:
URL: https://github.com/apache/storm/pull/3312#discussion_r469672682



##########
File path: storm-webapp/src/main/java/org/apache/storm/daemon/ui/UIHelpers.java
##########
@@ -1488,16 +1495,21 @@ private static Double nullToZero(Double value) {
      * @return getTopologySpoutAggStatsMap
      */
     private static Map<String, Object> 
getTopologySpoutAggStatsMap(ComponentAggregateStats componentAggregateStats,
-                                                                   String 
spoutId) {
+                                                                   String 
spoutId, Map<String, Object> config, String topologyId) {
         Map<String, Object> result = new HashMap();
         CommonAggregateStats commonStats = 
componentAggregateStats.get_common_stats();
         result.putAll(getCommonAggStatsMap(commonStats));
         result.put("spoutId", spoutId);
         result.put("encodedSpoutId", Utils.urlEncodeUtf8(spoutId));
         SpoutAggregateStats spoutAggregateStats = 
componentAggregateStats.get_specific_stats().get_spout();
-        result.put("completeLatency", 
spoutAggregateStats.get_complete_latency_ms());
+        result.put("completeLatency", 
StatsUtil.floatStr(spoutAggregateStats.get_complete_latency_ms()));
         ErrorInfo lastError = componentAggregateStats.get_last_error();
-        result.put("lastError", Objects.isNull(lastError) ?  "" : 
getTruncatedErrorString(lastError.get_error()));
+        if (!Objects.isNull(lastError)) {
+            result.putAll(getComponentErrorInfo(lastError, config, topologyId, 
true));
+        } else {
+            // Maintain backwards compatibility in the API response by setting 
empty string value

Review comment:
       Sounds good.  I'll update the code and API docs to reflect that.
   
   Thanks!




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


Reply via email to