Repository: storm
Updated Branches:
  refs/heads/master 2ed793d9b -> c5988e83d


[STORM-3023] fix the issue that Storm UI not showing correct values for 
component CPU, Memory and Executors


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/a50c2b14
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/a50c2b14
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/a50c2b14

Branch: refs/heads/master
Commit: a50c2b145e6403447aa6d7e4b74b80e80171b5d9
Parents: a8d84d6
Author: Ethan Li <[email protected]>
Authored: Mon Apr 9 18:16:41 2018 -0500
Committer: Ethan Li <[email protected]>
Committed: Tue Apr 10 14:45:45 2018 -0500

----------------------------------------------------------------------
 .../jvm/org/apache/storm/stats/StatsUtil.java   | 20 ++++----------------
 storm-core/src/clj/org/apache/storm/ui/core.clj | 12 ++++++------
 2 files changed, 10 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/a50c2b14/storm-client/src/jvm/org/apache/storm/stats/StatsUtil.java
----------------------------------------------------------------------
diff --git a/storm-client/src/jvm/org/apache/storm/stats/StatsUtil.java 
b/storm-client/src/jvm/org/apache/storm/stats/StatsUtil.java
index 965084f..c85214c 100644
--- a/storm-client/src/jvm/org/apache/storm/stats/StatsUtil.java
+++ b/storm-client/src/jvm/org/apache/storm/stats/StatsUtil.java
@@ -617,25 +617,13 @@ public class StatsUtil {
         // (merge-with merge-agg-comp-stats-topo-page-bolt/spout (acc-stats 
comp-key) cid->statk->num)
         // (acc-stats comp-key) ==> bolt2stats/spout2stats
         if (isSpout) {
-            Set<String> spouts = new HashSet<>();
-            spouts.addAll(spout2stats.keySet());
-            spouts.addAll(cid2stats.keySet());
-
-            Map<String, Object> mm = new HashMap<>();
-            for (String spout : spouts) {
-                mm.put(spout, mergeAggCompStatsTopoPageSpout((Map) 
spout2stats.get(spout), (Map) cid2stats.get(spout)));
+            for (String spout : cid2stats.keySet()) {
+                spout2stats.put(spout, mergeAggCompStatsTopoPageSpout((Map) 
spout2stats.get(spout), (Map) cid2stats.get(spout)));
             }
-            putKV(ret, SPOUT_TO_STATS, mm);
         } else {
-            Set<String> bolts = new HashSet<>();
-            bolts.addAll(bolt2stats.keySet());
-            bolts.addAll(cid2stats.keySet());
-
-            Map<String, Object> mm = new HashMap<>();
-            for (String bolt : bolts) {
-                mm.put(bolt, mergeAggCompStatsTopoPageBolt((Map) 
bolt2stats.get(bolt), (Map) cid2stats.get(bolt)));
+            for (String bolt : cid2stats.keySet()) {
+                bolt2stats.put(bolt, mergeAggCompStatsTopoPageBolt((Map) 
bolt2stats.get(bolt), (Map) cid2stats.get(bolt)));
             }
-            putKV(ret, BOLT_TO_STATS, mm);
         }
 
         return ret;

http://git-wip-us.apache.org/repos/asf/storm/blob/a50c2b14/storm-core/src/clj/org/apache/storm/ui/core.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/ui/core.clj 
b/storm-core/src/clj/org/apache/storm/ui/core.clj
index 3097881..f6e177d 100644
--- a/storm-core/src/clj/org/apache/storm/ui/core.clj
+++ b/storm-core/src/clj/org/apache/storm/ui/core.clj
@@ -661,9 +661,9 @@
    "transferred" (.get_transferred common-stats)
    "acked" (.get_acked common-stats)
    "failed" (.get_failed common-stats)
-   "requestedMemOnHeap" (.get (.get_resources_map common-stats) 
Config/TOPOLOGY_COMPONENT_RESOURCES_ONHEAP_MEMORY_MB)
-   "requestedMemOffHeap" (.get (.get_resources_map common-stats) 
Config/TOPOLOGY_COMPONENT_RESOURCES_OFFHEAP_MEMORY_MB)
-   "requestedCpu" (.get (.get_resources_map common-stats) 
Config/TOPOLOGY_COMPONENT_CPU_PCORE_PERCENT)})
+   "requestedMemOnHeap" (.get (.get_resources_map common-stats) 
Constants/COMMON_ONHEAP_MEMORY_RESOURCE_NAME)
+   "requestedMemOffHeap" (.get (.get_resources_map common-stats) 
Constants/COMMON_OFFHEAP_MEMORY_RESOURCE_NAME)
+   "requestedCpu" (.get (.get_resources_map common-stats) 
Constants/COMMON_CPU_RESOURCE_NAME)})
 
 (defmulti comp-agg-stats-json
   "Returns a JSON representation of aggregated statistics."
@@ -1105,9 +1105,9 @@
        "name" (.get_topology_name comp-page-info)
        "executors" (.get_num_executors comp-page-info)
        "tasks" (.get_num_tasks comp-page-info)
-       "requestedMemOnHeap" (.get (.get_resources_map comp-page-info) 
Config/TOPOLOGY_COMPONENT_RESOURCES_ONHEAP_MEMORY_MB)
-       "requestedMemOffHeap" (.get (.get_resources_map comp-page-info) 
Config/TOPOLOGY_COMPONENT_RESOURCES_OFFHEAP_MEMORY_MB)
-       "requestedCpu" (.get (.get_resources_map comp-page-info) 
Config/TOPOLOGY_COMPONENT_CPU_PCORE_PERCENT)
+       "requestedMemOnHeap" (.get (.get_resources_map comp-page-info) 
Constants/COMMON_ONHEAP_MEMORY_RESOURCE_NAME)
+       "requestedMemOffHeap" (.get (.get_resources_map comp-page-info) 
Constants/COMMON_OFFHEAP_MEMORY_RESOURCE_NAME)
+       "requestedCpu" (.get (.get_resources_map comp-page-info) 
Constants/COMMON_CPU_RESOURCE_NAME)
        "schedulerDisplayResource" (*STORM-CONF* SCHEDULER-DISPLAY-RESOURCE)
        "topologyId" topology-id
        "topologyStatus" (.get_topology_status comp-page-info)

Reply via email to