[ 
https://issues.apache.org/jira/browse/SAMZA-421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14222722#comment-14222722
 ] 

Yan Fang commented on SAMZA-421:
--------------------------------

This is because there is a "TIME_COLLISION_BUFFER" in the code, which is set to 
256. That means, only 256 updates will be recored in one millisecond. More 
updates in this millisecond will be overridden by the next millisecond's 
records. This piece of code is here 

{code}
 private long getUpdatingTime() {
    while (true) {
      long oldTime = lastUpdatingTime.get();
      long newTime = clock.currentTimeMillis() * TIME_COLLISION_BUFFER;
      long updatingTime = newTime > oldTime ? newTime : oldTime + 1;
      // make sure no other threads modify the lastUpdatingTime
      if (lastUpdatingTime.compareAndSet(oldTime, updatingTime)) {
        return updatingTime;
      }
    }
  }
{code}

So, even though there are 600k messages/sec, meaning, we have 600k*60*5 
updates, we only hold at most MAX( 5*60*1000*TIME_COLLISION_BUFFER(256),  
updates that happen in one millisecond + 5*60*1000*TIME_COLLISION_BUFFER(256)) 
data points in the memory.

> Test the performance before and after adding the Timer metric
> -------------------------------------------------------------
>
>                 Key: SAMZA-421
>                 URL: https://issues.apache.org/jira/browse/SAMZA-421
>             Project: Samza
>          Issue Type: Test
>          Components: metrics
>            Reporter: Yan Fang
>            Assignee: Yan Fang
>              Labels: newbie
>         Attachments: testTimer1.png, update-timer-speed.png
>
>
> As 
> [recommended|https://issues.apache.org/jira/browse/SAMZA-349?focusedCommentId=14128365&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14128365]
>  by Martin in SAMZA-349, it's worth testing the performance before and after 
> implementing the Timer metric.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to