Github user BuDongDong commented on the pull request: https://github.com/apache/storm/pull/348#issuecomment-66964691 (defrecord RollingWindow [updater merger extractor bucket-size-secs num-buckets buckets]) I think that the "bucket-size-secs" of RollingWindow is 20, and the "num-buckets" of RollingWindow is 30/540/4320. if not exchange the real argument ânum-bucketsâ and "s" of ârolling-windowâ function, then the "bucket-size-secs" of RollingWindow is 30/540/4320, and the "num-buckets" of RollingWindow is 20. creating CommonStats under not exchange the real argument ânum-bucketsâ and "s" of ârolling-windowâ function: (def NUM-STAT-BUCKETS 20) ;; 10 minutes, 3 hours, 1 day (def STAT-BUCKETS [30 540 4320]) (defn- mk-common-stats [rate] (CommonStats. (atom (apply keyed-counter-rolling-window-set NUM-STAT-BUCKETS STAT-BUCKETS)) (atom (apply keyed-counter-rolling-window-set NUM-STAT-BUCKETS STAT-BUCKETS)) rate)) "mk-common-stats" call " keyed-counter-rolling-window-set" ==>(apply keyed-counter-rolling-window-set 20 [30 540 4320]) (defn keyed-counter-rolling-window-set [num-buckets & bucket-sizes] (apply rolling-window-set incr-val (partial merge-with +) counter-extract num-buckets bucket-sizes)) "keyed-counter-rolling-window-set" call "rolling-window-set" ==>(apply rolling-window-set incr-val (partial merge-with +) counter-extract 20 [30 540 4320]) (defn rolling-window-set [updater merger extractor num-buckets & bucket-sizes] (RollingWindowSet. updater extractor (dofor [s bucket-sizes] (rolling-window updater merger extractor s num-buckets)) nil) ) "rolling-window-set" call constructor of "RollingWindowSet" ==>(RollingWindowSet. updater extractor (dofor [s [30 540 4320]] (rolling-window updater merger extractor s 20)) nil) constructor of "RollingWindowSet" call "rolling-window" ==>(rolling-window updater merger extractor 30 20) ==>(rolling-window updater merger extractor 540 20) ==>(rolling-window updater merger extractor 4320 20) (defn rolling-window [updater merger extractor bucket-size-secs num-buckets] (RollingWindow. updater merger extractor bucket-size-secs num-buckets {})) "rolling-window" call constructor of "RollingWindow" ==>(RollingWindow. updater merger extractor 30 20 {}) ==>(RollingWindow. updater merger extractor 540 20 {}) ==>(RollingWindow. updater merger extractor 4320 20 {}) if not exchange the real argument ânum-bucketsâ and "s" of ârolling-windowâ function, then the "bucket-size-secs" of RollingWindow is 30/540/4320, and the "num-buckets" of RollingWindow is 20. creating CommonStats under exchange the real argument ânum-bucketsâ and "s" of ârolling-windowâ function: ==>(RollingWindow. updater merger extractor 20 30 {}) ==>(RollingWindow. updater merger extractor 20 540 {}) ==>(RollingWindow. updater merger extractor 20 4320 {}) I think the "bucket-size-secs" should represent the size of bucket not the count of bucket; the ânum-bucketsâ should represent the count of bucket not the size of bucket. so it is necessary to exchange the real argument ânum-bucketsâ and "s" of ârolling-windowâ function
--- 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. ---