HBASE-10407 String Format Exception (Siwakorn Srisakaokul)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1562364 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2014-01-29 06:06:16 +00:00
parent 92d45e28c5
commit 013c6a6285
1 changed files with 4 additions and 6 deletions

View File

@ -82,14 +82,12 @@ public class MetricMutableQuantiles extends MutableMetric implements MetricHisto
"Number of %s for %s with %ds interval", lsName, desc, interval));
// Construct the MetricsInfos for the quantiles, converting to percentiles
quantileInfos = new MetricsInfo[quantiles.length];
String nameTemplate = ucName + "%dthPercentile" + interval + "sInterval"
+ uvName;
String descTemplate = "%d percentile " + lvName + " with " + interval
+ " second interval for " + desc;
String nameTemplate = "%s%dthPercentile%dsInterval%s";
String descTemplate = "%d percentile %s with %d second interval for %s";
for (int i = 0; i < quantiles.length; i++) {
int percentile = (int) (100 * quantiles[i].quantile);
quantileInfos[i] = info(String.format(nameTemplate, percentile),
String.format(descTemplate, percentile));
quantileInfos[i] = info(String.format(nameTemplate, ucName, percentile, interval, uvName),
String.format(descTemplate, percentile, lvName, interval, desc));
}
estimator = new MetricSampleQuantiles(quantiles);