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

Ivan Kelly commented on BOOKKEEPER-614:
---------------------------------------

This patch implements the comments I had on [~i0exception]'s patch, plus pulls 
in some stuff from the twitter repo. Counter[1] is a copy paste of 
SimpleStat[2].

For OpStatsLogger, the production code has to take care of recording the time 
at the start and logging at the end. I think it's cleaner to have the metrics 
framework do this, hence TimedOp.

Aniruddha's patch and twitters branch didn't have a Gauge abstraction (it uses 
SampledStat directly). 

It also lacks a plugin mechanism, which I add with this patch.

I don't like how StatsLogger used enums. This meant that to add a new stat, you 
had to modify something in the stats package as well as where you're recording 
the stat. It also means you need to have different implementations like 
PCBookieClientStatsLogger, BookKeeperServerStatsLogger and 
BookKeeperClientStatsLogger to hold the enum. This makes adds more overhead to 
recording a stat, and my goal with this is to make is as easy as possible.

So, in short, I've used some of it and changed other parts of it that I didn't 
like, and I added stuff which was missing.

I haven't thought deeply on the JMX compat issue yet, but initial idea for it 
would be that we have a default JMX provider, and expose the stats in a 
compatible manner that way. 

[1] 
https://github.com/ivankelly/bookkeeper/blob/430088a37a8e4cfed77f9267d081b52701620d53/bookkeeper-stats/src/main/java/org/apache/bookkeeper/stats/Counter.java
[2] 
https://github.com/twitter/bookkeeper/blob/master/bookkeeper-server/src/main/java/org/apache/bookkeeper/stats/SimpleStat.java
[3] 
https://github.com/twitter/bookkeeper/blob/master/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java#L50
                
> Generic stats interface, which multiple providers can be plugged into
> ---------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-614
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-614
>             Project: Bookkeeper
>          Issue Type: Improvement
>            Reporter: Ivan Kelly
>            Assignee: Ivan Kelly
>             Fix For: 4.3.0
>
>         Attachments: 
> 0001-BOOKKEEPER-614-Generic-stats-interface-which-multipl.patch
>
>
> Currently we collect stats though JMX. Adding a new stat to JMX is 
> cumbersome, and reading the stats out of JMX is painful if you're not on the 
> same machine. As a consequence, we aren't measuring a fraction of the stuff 
> we should be.
> There are a couple of nice stats packages out there, such as twitter-stats[1] 
> and codahale metrics[2], which would make collection of stats much easier.
> This JIRA is to provide a generic interface, which a metrics backend can be 
> plugged into.
> [1] 
> https://github.com/twitter/commons/tree/master/src/java/com/twitter/common/stats
> [2] http://metrics.codahale.com/

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to