You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by BuDongDong <gi...@git.apache.org> on 2014/12/15 09:53:05 UTC

[GitHub] storm pull request: Update stats.clj "rolling-window-set" function...

GitHub user BuDongDong opened a pull request:

    https://github.com/apache/storm/pull/348

    Update stats.clj "rolling-window-set" function, exchange the real argume...

    ...nt "num-buckets" and "s" of "rolling-window" function
    
    (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)
    )
    (defrecord RollingWindow [updater merger extractor bucket-size-secs num-buckets buckets])
    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
    I think that the "bucket-size-secs" of RollingWindow is 20, and the "num-buckets" of RollingWindow is 30/540/4320.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/BuDongDong/storm-1 master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/storm/pull/348.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #348
    
----
commit b827d660bf18f711da36012355c7d06e35b926e3
Author: zhangjinlong <zh...@126.com>
Date:   2014-12-15T08:50:50Z

    Update stats.clj "rolling-window-set" function, exchange the real argument "num-buckets" and "s" of "rolling-window" function
    
    (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)
    )
    (defrecord RollingWindow [updater merger extractor bucket-size-secs num-buckets buckets])
    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
    I think that the "bucket-size-secs" of RollingWindow is 20, and the "num-buckets" of RollingWindow is 30/540/4320.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request: Update stats.clj "rolling-window-set" function...

Posted by BuDongDong <gi...@git.apache.org>.
Github user BuDongDong commented on the pull request:

    https://github.com/apache/storm/pull/348#issuecomment-67004693
  
    @nathanmarz Could you check this bug, thank you very much


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request: Update stats.clj "rolling-window-set" function...

Posted by BuDongDong <gi...@git.apache.org>.
Github user BuDongDong closed the pull request at:

    https://github.com/apache/storm/pull/348


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request: Update stats.clj "rolling-window-set" function...

Posted by BuDongDong <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---