StringUtils.limitDecimalTo2(master.getServerManager().getAverageLoad())), jamonWriter);
/** * Return an abbreviated English-language desc of the byte length */ public static String byteDesc(long len) { double val = 0.0; String ending = ""; if (len < 1024 * 1024) { val = (1.0 * len) / 1024; ending = " KB"; } else if (len < 1024 * 1024 * 1024) { val = (1.0 * len) / (1024 * 1024); ending = " MB"; } else if (len < 1024L * 1024 * 1024 * 1024) { val = (1.0 * len) / (1024 * 1024 * 1024); ending = " GB"; } else if (len < 1024L * 1024 * 1024 * 1024 * 1024) { val = (1.0 * len) / (1024L * 1024 * 1024 * 1024); ending = " TB"; } else { val = (1.0 * len) / (1024L * 1024 * 1024 * 1024 * 1024); ending = " PB"; } return limitDecimalTo2(val) + ending; }
/** * @deprecated Consider using {@link org.apache.hadoop.util.StringUtils#limitDecimalTo2} instead. */ @Deprecated public static synchronized String limitDecimalTo2(double d) { return StringUtils.limitDecimalTo2(d); }
/** * @deprecated Consider using {@link org.apache.hadoop.util.StringUtils#limitDecimalTo2} instead. */ @Deprecated public static synchronized String limitDecimalTo2(double d) { return StringUtils.limitDecimalTo2(d); }
/** A formatted string for printing the status of the DataNode. */ public String dumpDatanode() { StringBuffer buffer = new StringBuffer(); long c = getCapacity(); long r = getRemaining(); long u = getDfsUsed(); buffer.append(name); if (!NetworkTopology.DEFAULT_RACK.equals(location)) { buffer.append(" "+location); } if (isDecommissioned()) { buffer.append(" DD"); } else if (isDecommissionInProgress()) { buffer.append(" DP"); } else { buffer.append(" IN"); } buffer.append(" " + c + "(" + StringUtils.byteDesc(c)+")"); buffer.append(" " + u + "(" + StringUtils.byteDesc(u)+")"); buffer.append(" " + StringUtils.limitDecimalTo2(((1.0*u)/c)*100)+"%"); buffer.append(" " + r + "(" + StringUtils.byteDesc(r)+")"); buffer.append(" " + new Date(lastUpdate)); return buffer.toString(); }
/** A formatted string for reporting the status of the DataNode. */ public String getDatanodeReport() { StringBuffer buffer = new StringBuffer(); long c = getCapacity(); long r = getRemaining(); long u = getDfsUsed(); long nonDFSUsed = getNonDfsUsed(); float usedPercent = getDfsUsedPercent(); float remainingPercent = getRemainingPercent(); buffer.append("Name: "+name+"\n"); if (!NetworkTopology.DEFAULT_RACK.equals(location)) { buffer.append("Rack: "+location+"\n"); } buffer.append("Decommission Status : "); if (isDecommissioned()) { buffer.append("Decommissioned\n"); } else if (isDecommissionInProgress()) { buffer.append("Decommission in progress\n"); } else { buffer.append("Normal\n"); } buffer.append("Configured Capacity: "+c+" ("+StringUtils.byteDesc(c)+")"+"\n"); buffer.append("DFS Used: "+u+" ("+StringUtils.byteDesc(u)+")"+"\n"); buffer.append("Non DFS Used: "+nonDFSUsed+" ("+StringUtils.byteDesc(nonDFSUsed)+")"+"\n"); buffer.append("DFS Remaining: " +r+ "("+StringUtils.byteDesc(r)+")"+"\n"); buffer.append("DFS Used%: "+StringUtils.limitDecimalTo2(usedPercent)+"%\n"); buffer.append("DFS Remaining%: "+StringUtils.limitDecimalTo2(remainingPercent)+"%\n"); buffer.append("Last contact: "+new Date(lastUpdate)+"\n"); return buffer.toString(); }
private StringBuilder appendHistogram(StringBuilder sb, MetricsHistogram histogram) { sb = Strings.appendKeyValue(sb, histogram.getName() + "Mean", StringUtils.limitDecimalTo2(histogram.getMean())); sb = Strings.appendKeyValue(sb, histogram.getName() + "Count", StringUtils.limitDecimalTo2(histogram.getCount())); final Snapshot s = histogram.getSnapshot(); sb = Strings.appendKeyValue(sb, histogram.getName() + "Median", StringUtils.limitDecimalTo2(s.getMedian())); sb = Strings.appendKeyValue(sb, histogram.getName() + "75th", StringUtils.limitDecimalTo2(s.get75thPercentile())); sb = Strings.appendKeyValue(sb, histogram.getName() + "95th", StringUtils.limitDecimalTo2(s.get95thPercentile())); sb = Strings.appendKeyValue(sb, histogram.getName() + "99th", StringUtils.limitDecimalTo2(s.get99thPercentile())); sb = Strings.appendKeyValue(sb, histogram.getName() + "999th", StringUtils.limitDecimalTo2(s.get999thPercentile())); return sb; } }
+ " (" + StringUtils.byteDesc(used) + ")"); System.out.println("DFS Used%: " + StringUtils.limitDecimalTo2(((1.0 * used) / presentCapacity) * 100) + "%");
Long.valueOf(memory.getMax()/MB)); sb = Strings.appendKeyValue(sb, this.blockCacheSize.getName()+"MB", StringUtils.limitDecimalTo2((float)this.blockCacheSize.get()/MB)); sb = Strings.appendKeyValue(sb, this.blockCacheFree.getName()+"MB", StringUtils.limitDecimalTo2((float)this.blockCacheFree.get()/MB)); sb = Strings.appendKeyValue(sb, this.blockCacheCount.getName(), Long.valueOf(this.blockCacheCount.get()));
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.limitDecimalTo2(master.getServerManager().getAverageLoad())), jamonWriter);
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.limitDecimalTo2(master.getFServerManager().getAverageLoad())), jamonWriter);
StringUtils.limitDecimalTo2(master.getServerManager().getAverageLoad())), jamonWriter);