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

Martin Kleppmann commented on SAMZA-349:
----------------------------------------

I just realized another issue: the Counter class has a decrement method. That 
means it can be used for things that are not monotonically increasing, and 
indeed they are: SAMZA-245 (which I'm reviewing just now) added an 
unprocessedMessages metric which tracks the length of a queue of unprocessed 
messages. As the queue grows and shrinks, that counter is incremented and 
decremented.

A counter that can be decremented can't meaningfully report a rate (number of 
events per minute). If we're going to switch the MetricsSnapshotReporter to 
report the delta since the last minutely report, I'd say we should also remove 
the dec() methods on Counter.

> MetricsSnapshotReporter does not refresh metrics every 60 seconds
> -----------------------------------------------------------------
>
>                 Key: SAMZA-349
>                 URL: https://issues.apache.org/jira/browse/SAMZA-349
>             Project: Samza
>          Issue Type: Bug
>            Reporter: Yan Fang
>            Assignee: Yan Fang
>         Attachments: SAMZA-349.1.patch, SAMZA-349.patch
>
>
> If my understanding is correct, the metrics we provide are for every 60 
> seconds and all counters will be reset every 60 seconds. Current the 
> MetricsSnapshotReporter seems missing this implementation. It sends out the 
> metrics every 60 seconds but does not reset the counter value.
> {code}
>  registry.getGroup(group).foreach {
>           case (name, metric) =>
>             metric.visit(new MetricsVisitor {
>               def counter(counter: Counter) = groupMsg.put(name, 
> counter.getCount: java.lang.Long)
>               def gauge[T](gauge: Gauge[T]) = groupMsg.put(name, 
> gauge.getValue.asInstanceOf[Object])
>             })
>         }
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to