Github user nickwallen commented on the issue:

    https://github.com/apache/incubator-metron/pull/387
  
    I had hit the first two, but not the last.  I just setup an additional 
manual test that covers all of these scenarios.  More specifically, here are 
the profiles that I defined.  
    
    ```
    {
      "profiles": [
        {
          "profile": "counter",
          "foreach": "'global'",
          "init":  { "s": 0 },
          "update":  { "s": "s + 1" },
          "result":  "s"
        },
        {
          "profile": "by-ip",
          "foreach": "ip_src_addr",
          "init":  { "s": 0 },
          "update":  { "s": "s + 1" },
          "result":  "s"
        },
        {
          "profile": "always-zero",
          "foreach": "ip_src_addr",
          "init":  { "s": 0 },
          "update":  { "s": 0 },
          "result":  "s"
        }
      ]
    }
    ```
    
    One of the profiles counts messages that it sees "globally", the next 
counts the number of messages by source IP, and the last likes to always 
zero-out the same variable named "s", just to see if it can muck with the other 
two profiles.  
    
    The `always-zero` profile as expected remains 0.  I can see additional 
values being written as time progresses.
    ```
    [Stellar]>>> PROFILE_GET("always-zero","72.34.49.86", 5, "MINUTES")
    [0, 0]
    [Stellar]>>> PROFILE_GET("always-zero","72.34.49.86", 5, "MINUTES")
    [0, 0, 0]
    ```
    
    All of these profiles share the same variable 's', so if there was some 
kind of bad intermingling, I would expect the `always-zero` profile to 
seriously muck things up for the other two profiles.  But I do not see any of 
that.  
    
    I can see new values being added to the `by-ip` profile.
    ```
    [Stellar]>>> PROFILE_GET("by-ip","72.34.49.86", 5, "MINUTES")
    [10.0, 106.0]
    [Stellar]>>> PROFILE_GET("by-ip","72.34.49.86", 5, "MINUTES")
    [10.0, 106.0, 58.0]
    
    [Stellar]>>> PROFILE_GET("by-ip","192.168.138.158", 5, "MINUTES")
    [296.0, 303.0, 302.0]
    [Stellar]>>> PROFILE_GET("by-ip","192.168.138.158", 7, "MINUTES")
    [296.0, 303.0, 302.0, 303.0]
    ```
    
    The "global" profile is also behaving properly.
    ```
    [Stellar]>>> PROFILE_GET("counter","global", 5, "MINUTES")
    [833.0, 319.0, 746.0]
    [Stellar]>>> PROFILE_GET("counter","global", 6, "MINUTES")
    [833.0, 319.0, 746.0, 1538.0]
    ```



---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to