[
https://issues.apache.org/jira/browse/SOLR-2698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13079429#comment-13079429
]
Mark Miller commented on SOLR-2698:
-----------------------------------
bq. FileUtils.byteCountToDisplaySize( ) will not round the size of a file
Ah, right, good catch! This is actually why I implemented our own version in
one of our projects (similar to the one in rep handler). Had forgotten the
reason for that! See below. I see the following JIRA issue as well:
https://issues.apache.org/jira/browse/IO-226
So yeah, +1 on the new Util method.
{code}
/**
* Return good default units based on byte size.
*/
public static String humanReadableUnits(long bytes) {
String newSizeAndUnits;
DecimalFormat df = new DecimalFormat("#.#");
if (bytes / ONE_GB > 0) {
newSizeAndUnits = String.valueOf(df.format((float)bytes / ONE_GB)) + "
GB";
} else if (bytes / ONE_MB > 0) {
newSizeAndUnits = String.valueOf(df.format((float)bytes / ONE_MB)) + "
MB";
} else if (bytes / ONE_KB > 0) {
newSizeAndUnits = String.valueOf(df.format((float)bytes / ONE_KB)) + "
KB";
} else {
newSizeAndUnits = String.valueOf(bytes) + " bytes";
}
return newSizeAndUnits;
}
{code}
> Enhance CoreAdmin STATUS command to return index size
> -----------------------------------------------------
>
> Key: SOLR-2698
> URL: https://issues.apache.org/jira/browse/SOLR-2698
> Project: Solr
> Issue Type: Improvement
> Components: multicore
> Affects Versions: 4.0
> Reporter: Yury Kats
> Assignee: Mark Miller
> Attachments: SOLR-2698.patch
>
>
> CoreAdmin STATUS command returns all kinds of index info for all cores on the
> server, except for the index size.
> However, indexSize can be retrieved for an individual core via a
> /replication&command=details request.
> I have N Solrs servers, running M cores each. My application is monitoring
> the status of all cores, including their index size.
> As it stands today, I need to issue N status requests plus N*M replication
> requests to get all the information I need.
> If STATUS command returned indexSize, number of requests would be just N.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]