Github user jerrypeng commented on a diff in the pull request:

    https://github.com/apache/storm/pull/881#discussion_r45250004
  
    --- Diff: storm-core/src/clj/backtype/storm/stats.clj ---
    @@ -335,30 +358,21 @@
     (defn- agg-bolt-streams-lat-and-count
       "Aggregates number executed and process & execute latencies."
       [idk->exec-avg idk->proc-avg idk->executed]
    -  {:pre (apply = (map #(set (keys %))
    -                      [idk->exec-avg
    -                       idk->proc-avg
    -                       idk->executed]))}
    -  (letfn [(weight-avg [id avg] (let [num-e (idk->executed id)]
    -                                   (if (and avg num-e)
    -                                     (* avg num-e)
    -                                     0)))]
    +  (letfn [(weight-avg [id avg]
    +            (let [num-e (idk->executed id)]
    +              (product-or-0 avg num-e)))]
         (into {}
           (for [k (keys idk->exec-avg)]
    -        [k {:executeLatencyTotal (weight-avg k (idk->exec-avg k))
    -            :processLatencyTotal (weight-avg k (idk->proc-avg k))
    +        [k {:executeLatencyTotal (weight-avg k (get idk->exec-avg k))
    +            :processLatencyTotal (weight-avg k (get idk->proc-avg k))
    --- End diff --
    
    what is the point of adding the get especially for (get idk->exec-avg k)? 
you are getting the keys from the map and then accessing it right? the keys 
cannot possibly not exist in the map


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to