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

Joel Knighton commented on CASSANDRA-9692:
------------------------------------------

Thanks [~giampaolo] - if you want to ping me on JIRA and the autocomplete isn't 
working, you can use {{jkni}} for my username.

This patch looks good - I pushed another review commit on my branch at 
[9692-trunk|https://github.com/jkni/cassandra/tree/9692-trunk]. This fixes some 
minor whitespace/formatting issues to bring the patch in line with project 
conventions and proposes one fairly major change described in the following 
paragraph.

I'm not sure about the return value for 0 divisor in 
FBUtilities.bytesPerSeconds. While returning -1 might make sense for 
statistics, I'm a little wary of putting a method like that in FBUtilities 
where it is likely to be used for others, possibly for calculations where we 
would rather throw an exception. Instead, I propose two rate pretty printing 
functions - one that takes memory and time and returns NaN if time is zero, and 
one takes a rate calculated elsewhere. This removes the need to choose one way 
to handle bytesPerSeconds 0 divisors and allows each caller to calculate the 
rate as needed. At the same time, it sanely handles the common case of pretty 
printing a rate that needs no further calculation. If you have any concerns 
with this approach, let me know. I've also renamed the prettyPrintRateInSeconds 
method name to prettyPrintMemoryPerSecond to better reflect its purpose.

Since most of these changes seem likely to be agreed upon, I've pushed the 
patch for a first round of CI.
||branch||testall||dtest||
|[9692-trunk|https://github.com/jkni/cassandra/tree/9692-trunk]|[testall|http://cassci.datastax.com/view/Dev/view/jkni/job/jkni-9692-trunk-testall]|[dtest|http://cassci.datastax.com/view/Dev/view/jkni/job/jkni-9692-trunk-dtest]|



> Print sensible units for all log messages
> -----------------------------------------
>
>                 Key: CASSANDRA-9692
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9692
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Benedict
>            Assignee: Giampaolo
>            Priority: Minor
>              Labels: lhf
>             Fix For: 3.x
>
>         Attachments: 
> Cassandra9692-Rev1-trunk-giampaolo-trapasso-at-radicalbit-io.diff, 
> Cassandra9692-trunk-giampaolo-trapasso-at-radicalbit-io.diff
>
>
> Like CASSANDRA-9691, this has bugged me too long. it also adversely impacts 
> log analysis. I've introduced some improvements to the bits I touched for 
> CASSANDRA-9681, but we should do this across the codebase. It's a small 
> investment for a lot of long term clarity in the logs.



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

Reply via email to