cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Giampaolo (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-9692) Print sensible units for all log messages
Date Thu, 18 Feb 2016 14:50:18 GMT

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

Giampaolo commented on CASSANDRA-9692:
--------------------------------------

I've finished this task and I'm double checking the code before submit the patch. To avoid
recycles of the patch I have four simple questions.
1. How about changing {{FBUtilities.prettyPrintMemory}} this way? I think that is size is
< 1024, makes sense to see, for example {{512 bytes}}, instead of {{0.512}} KiB
{code:title=FBUtilities.java}
public static String prettyPrintMemory(long size)
{
    if (size >= 1 << 30)
        return String.format("%.3fGiB", size / (double) (1 << 30));
    if (size >= 1 << 20)
        return String.format("%.3fMiB", size / (double) (1 << 20));
    if (size >= 1 << 10)
        return String.format("%.3fKiB", size / (double) (1 << 10));
    return String.format("%d bytes", size);
}
{code}
2. Sometimes, the "bytes" unit of measure is not present in log, like
[this|https://github.com/apache/cassandra/blob/29525005071dd7321c5d444cb7e898a18057ba67/src/java/org/apache/cassandra/db/compaction/writers/SplittingSizeTieredCompactionWriter.java#L98]
or [this|https://github.com/apache/cassandra/blob/8036f04c08385fadc4c527fca5b3478171ae31dc/src/java/org/apache/cassandra/streaming/StreamReader.java#L102],
is it good to pretty print in these case also?
3. I've changed only logger stuff, however there are a lot of exceptions like [this|https://github.com/apache/cassandra/blob/7374e9b5ab08c1f1e612bf72293ea14c959b0c3c/src/java/org/apache/cassandra/db/commitlog/CommitLog.java#L267].
I think that in this case also, pretty printing would be better, should I change these also
or does it require a separate task?
4. As question 3, but for other cases, like [this|https://github.com/apache/cassandra/blob/9f322ac600d8cbd8d06427a0b11cea59991ba5ee/src/java/org/apache/cassandra/tools/BulkLoader.java#L252]

Let me know. Thanks in advance.


> 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
>            Priority: Minor
>              Labels: lhf
>             Fix For: 3.x
>
>
> 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)

Mime
View raw message