/** * Append to a StringBuilder a key/value. * Uses default separators. * @param sb StringBuilder to use * @param key Key to append. * @param value Value to append. * @return Passed <code>sb</code> populated with key/value. */ public static StringBuilder appendKeyValue(final StringBuilder sb, final String key, final Object value) { return appendKeyValue(sb, key, value, DEFAULT_SEPARATOR, DEFAULT_KEYVALUE_SEPARATOR); }
/** * sinkToString * @return a string contains sinkReplicationLoad information */ public String sinkToString() { if (this.replicationLoadSink == null) return null; StringBuilder sb = new StringBuilder(); sb = Strings.appendKeyValue(sb, "AgeOfLastAppliedOp", this.replicationLoadSink.getAgeOfLastAppliedOp()); sb = Strings.appendKeyValue(sb, "TimestampsOfLastAppliedOp", (new Date(this.replicationLoadSink.getTimeStampsOfLastAppliedOp()).toString())); return sb.toString(); }
/** * sourceToString * @return a string contains sourceReplicationLoad information */ public String sourceToString() { if (this.sourceMetricsList == null) return null; StringBuilder sb = new StringBuilder(); for (ClusterStatusProtos.ReplicationLoadSource rls : this.replicationLoadSourceList) { sb = Strings.appendKeyValue(sb, "\n PeerID", rls.getPeerID()); sb = Strings.appendKeyValue(sb, "AgeOfLastShippedOp", rls.getAgeOfLastShippedOp()); sb = Strings.appendKeyValue(sb, "SizeOfLogQueue", rls.getSizeOfLogQueue()); sb = Strings.appendKeyValue(sb, "TimestampsOfLastShippedOp", (new Date(rls.getTimeStampOfLastShippedOp()).toString())); sb = Strings.appendKeyValue(sb, "Replication Lag", rls.getReplicationLag()); } return sb.toString(); }
StringBuilder sb = Strings.appendKeyValue(new StringBuilder(), "requestsPerSecond", Double.valueOf(getRequestsPerSecond())); Strings.appendKeyValue(sb, "numberOfOnlineRegions", Integer.valueOf(getNumberOfRegions())); Strings.appendKeyValue(sb, "usedHeapMB", Integer.valueOf(this.getUsedHeapMB())); Strings.appendKeyValue(sb, "maxHeapMB", Integer.valueOf(getMaxHeapMB())); Strings.appendKeyValue(sb, "numberOfStores", Integer.valueOf(this.stores)); Strings.appendKeyValue(sb, "numberOfStorefiles", Integer.valueOf(this.storefiles)); Strings.appendKeyValue(sb, "storefileUncompressedSizeMB", Integer.valueOf(this.storeUncompressedSizeMB)); Strings.appendKeyValue(sb, "storefileSizeMB", Integer.valueOf(this.storefileSizeMB)); if (this.storeUncompressedSizeMB != 0) { Strings.appendKeyValue(sb, "compressionRatio", String.format("%.4f", (float) this.storefileSizeMB / (float) this.storeUncompressedSizeMB)); Strings.appendKeyValue(sb, "memstoreSizeMB", Integer.valueOf(this.memstoreSizeMB)); Strings.appendKeyValue(sb, "storefileIndexSizeKB", Long.valueOf(this.storefileIndexSizeKB)); Strings.appendKeyValue(sb, "readRequestsCount", Long.valueOf(this.readRequestsCount)); Strings.appendKeyValue(sb, "cpRequestsCount", Long.valueOf(this.cpRequestsCount)); Strings.appendKeyValue(sb, "filteredReadRequestsCount", Long.valueOf(this.filteredReadRequestsCount)); Strings.appendKeyValue(sb, "writeRequestsCount", Long.valueOf(this.writeRequestsCount)); Strings.appendKeyValue(sb, "rootIndexSizeKB", Integer.valueOf(this.rootIndexSizeKB)); Strings.appendKeyValue(sb, "totalStaticIndexSizeKB", Integer.valueOf(this.totalStaticIndexSizeKB)); Strings.appendKeyValue(sb, "totalStaticBloomSizeKB", Integer.valueOf(this.totalStaticBloomSizeKB)); Strings.appendKeyValue(sb, "totalCompactingKVs", Long.valueOf(this.totalCompactingKVs)); Strings.appendKeyValue(sb, "currentCompactedKVs", Long.valueOf(this.currentCompactedKVs));
StringBuilder sb = Strings.appendKeyValue(new StringBuilder(), "requestsPerSecond", Double.valueOf(getRequestCountPerSecond())); Strings.appendKeyValue(sb, "numberOfOnlineRegions", Integer.valueOf(getRegionMetrics().size())); Strings.appendKeyValue(sb, "usedHeapMB", getUsedHeapSize()); Strings.appendKeyValue(sb, "maxHeapMB", getMaxHeapSize()); Strings.appendKeyValue(sb, "numberOfStores", storeCount); Strings.appendKeyValue(sb, "numberOfStorefiles", storeFileCount); Strings.appendKeyValue(sb, "storefileUncompressedSizeMB", uncompressedStoreFileSizeMB); Strings.appendKeyValue(sb, "storefileSizeMB", storeFileSizeMB); if (uncompressedStoreFileSizeMB != 0) { Strings.appendKeyValue(sb, "compressionRatio", String.format("%.4f", (float) storeFileSizeMB / (float) uncompressedStoreFileSizeMB)); Strings.appendKeyValue(sb, "memstoreSizeMB", memStoreSizeMB); Strings.appendKeyValue(sb, "readRequestsCount", readRequestsCount); Strings.appendKeyValue(sb, "cpRequestsCount", cpRequestsCount); Strings.appendKeyValue(sb, "filteredReadRequestsCount", filteredReadRequestsCount); Strings.appendKeyValue(sb, "writeRequestsCount", writeRequestsCount); Strings.appendKeyValue(sb, "rootIndexSizeKB", rootLevelIndexSizeKB); Strings.appendKeyValue(sb, "totalStaticIndexSizeKB", storefileIndexSizeKB); Strings.appendKeyValue(sb, "totalStaticBloomSizeKB", bloomFilterSizeMB); Strings.appendKeyValue(sb, "totalCompactingKVs", compactingCellCount); Strings.appendKeyValue(sb, "currentCompactedKVs", compactedCellCount); float compactionProgressPct = Float.NaN; if (compactingCellCount > 0) { Strings.appendKeyValue(sb, "compactionProgressPct", compactionProgressPct); Strings.appendKeyValue(sb, "coprocessors", getCoprocessorNames());
StringBuilder sb = Strings.appendKeyValue(new StringBuilder(), "numberOfStores", this.getStores()); Strings.appendKeyValue(sb, "numberOfStorefiles", this.getStorefiles()); Strings.appendKeyValue(sb, "storefileUncompressedSizeMB", this.getStoreUncompressedSizeMB()); Strings.appendKeyValue(sb, "lastMajorCompactionTimestamp", this.getLastMajorCompactionTs()); Strings.appendKeyValue(sb, "storefileSizeMB", this.getStorefileSizeMB()); if (this.getStoreUncompressedSizeMB() != 0) { Strings.appendKeyValue(sb, "compressionRatio", String.format("%.4f", (float) this.getStorefileSizeMB() / (float) this.getStoreUncompressedSizeMB())); Strings.appendKeyValue(sb, "memstoreSizeMB", this.getMemStoreSizeMB()); Strings.appendKeyValue(sb, "readRequestsCount", this.getReadRequestsCount()); Strings.appendKeyValue(sb, "writeRequestsCount", this.getWriteRequestsCount()); Strings.appendKeyValue(sb, "rootIndexSizeKB", this.getRootIndexSizeKB()); Strings.appendKeyValue(sb, "totalStaticIndexSizeKB", this.getTotalStaticIndexSizeKB()); Strings.appendKeyValue(sb, "totalStaticBloomSizeKB", this.getTotalStaticBloomSizeKB()); Strings.appendKeyValue(sb, "totalCompactingKVs", this.getTotalCompactingKVs()); Strings.appendKeyValue(sb, "currentCompactedKVs", this.getCurrentCompactedKVs());
@Override public String toString() { StringBuilder sb = Strings.appendKeyValue(new StringBuilder(), "storeCount", this.getStoreCount()); Strings.appendKeyValue(sb, "storeFileCount", this.getStoreFileCount()); Strings.appendKeyValue(sb, "uncompressedStoreFileSize", this.getUncompressedStoreFileSize()); Strings.appendKeyValue(sb, "lastMajorCompactionTimestamp", this.getLastMajorCompactionTimestamp()); Strings.appendKeyValue(sb, "storeFileSize", this.getStoreFileSize()); if (this.getUncompressedStoreFileSize().get() != 0) { Strings.appendKeyValue(sb, "compressionRatio", String.format("%.4f", (float) this.getStoreFileSize().get(Size.Unit.MEGABYTE) / (float) this.getUncompressedStoreFileSize().get(Size.Unit.MEGABYTE))); Strings.appendKeyValue(sb, "memStoreSize", this.getMemStoreSize()); Strings.appendKeyValue(sb, "readRequestCount", this.getReadRequestCount()); Strings.appendKeyValue(sb, "cpRequestCount", this.getCpRequestCount()); Strings.appendKeyValue(sb, "writeRequestCount", this.getWriteRequestCount()); Strings.appendKeyValue(sb, "rootLevelIndexSize", this.getStoreFileRootLevelIndexSize()); Strings.appendKeyValue(sb, "uncompressedDataIndexSize", this.getStoreFileUncompressedDataIndexSize());
StringBuilder sb = Strings.appendKeyValue(new StringBuilder(), "requestsPerSecond", Double.valueOf(getRequestsPerSecond())); Strings.appendKeyValue(sb, "numberOfOnlineRegions", Integer.valueOf(getNumberOfRegions())); Strings.appendKeyValue(sb, "usedHeapMB", Integer.valueOf(this.getUsedHeapMB())); Strings.appendKeyValue(sb, "maxHeapMB", Integer.valueOf(getMaxHeapMB())); Strings.appendKeyValue(sb, "numberOfStores", Integer.valueOf(this.stores)); Strings.appendKeyValue(sb, "numberOfStorefiles", Integer.valueOf(this.storefiles)); Strings.appendKeyValue(sb, "storefileUncompressedSizeMB", Integer.valueOf(this.storeUncompressedSizeMB)); Strings.appendKeyValue(sb, "storefileSizeMB", Integer.valueOf(this.storefileSizeMB)); if (this.storeUncompressedSizeMB != 0) { Strings.appendKeyValue(sb, "compressionRatio", String.format("%.4f", (float) this.storefileSizeMB / (float) this.storeUncompressedSizeMB)); Strings.appendKeyValue(sb, "memstoreSizeMB", Integer.valueOf(this.memstoreSizeMB)); Strings.appendKeyValue(sb, "storefileIndexSizeKB", Long.valueOf(this.storefileIndexSizeKB)); Strings.appendKeyValue(sb, "readRequestsCount", Long.valueOf(this.readRequestsCount)); Strings.appendKeyValue(sb, "filteredReadRequestsCount", Long.valueOf(this.filteredReadRequestsCount)); Strings.appendKeyValue(sb, "writeRequestsCount", Long.valueOf(this.writeRequestsCount)); Strings.appendKeyValue(sb, "rootIndexSizeKB", Integer.valueOf(this.rootIndexSizeKB)); Strings.appendKeyValue(sb, "totalStaticIndexSizeKB", Integer.valueOf(this.totalStaticIndexSizeKB)); Strings.appendKeyValue(sb, "totalStaticBloomSizeKB", Integer.valueOf(this.totalStaticBloomSizeKB)); Strings.appendKeyValue(sb, "totalCompactingKVs", Long.valueOf(this.totalCompactingKVs)); Strings.appendKeyValue(sb, "currentCompactedKVs", Long.valueOf(this.currentCompactedKVs)); float compactionProgressPct = Float.NaN;
StringBuilder sb = Strings.appendKeyValue(new StringBuilder(), "numberOfStores", this.getStores()); Strings.appendKeyValue(sb, "numberOfStorefiles", this.getStorefiles()); Strings.appendKeyValue(sb, "storefileUncompressedSizeMB", this.getStoreUncompressedSizeMB()); Strings.appendKeyValue(sb, "lastMajorCompactionTimestamp", this.getLastMajorCompactionTs()); Strings.appendKeyValue(sb, "storefileSizeMB", this.getStorefileSizeMB()); if (this.getStoreUncompressedSizeMB() != 0) { Strings.appendKeyValue(sb, "compressionRatio", String.format("%.4f", (float) this.getStorefileSizeMB() / (float) this.getStoreUncompressedSizeMB())); Strings.appendKeyValue(sb, "memstoreSizeMB", this.getMemStoreSizeMB()); Strings.appendKeyValue(sb, "readRequestsCount", this.getReadRequestsCount()); Strings.appendKeyValue(sb, "writeRequestsCount", this.getWriteRequestsCount()); Strings.appendKeyValue(sb, "rootIndexSizeKB", this.getRootIndexSizeKB()); Strings.appendKeyValue(sb, "totalStaticIndexSizeKB", this.getTotalStaticIndexSizeKB()); Strings.appendKeyValue(sb, "totalStaticBloomSizeKB", this.getTotalStaticBloomSizeKB()); Strings.appendKeyValue(sb, "totalCompactingKVs", this.getTotalCompactingKVs()); Strings.appendKeyValue(sb, "currentCompactedKVs", this.getCurrentCompactedKVs());
StringBuilder sb = Strings.appendKeyValue(new StringBuilder(), "requestsPerSecond", Double.valueOf(getRequestCountPerSecond())); Strings.appendKeyValue(sb, "numberOfOnlineRegions", Integer.valueOf(getRegionMetrics().size())); Strings.appendKeyValue(sb, "usedHeapMB", getUsedHeapSize()); Strings.appendKeyValue(sb, "maxHeapMB", getMaxHeapSize()); Strings.appendKeyValue(sb, "numberOfStores", storeCount); Strings.appendKeyValue(sb, "numberOfStorefiles", storeFileCount); Strings.appendKeyValue(sb, "storefileUncompressedSizeMB", uncompressedStoreFileSizeMB); Strings.appendKeyValue(sb, "storefileSizeMB", storeFileSizeMB); if (uncompressedStoreFileSizeMB != 0) { Strings.appendKeyValue(sb, "compressionRatio", String.format("%.4f", (float) storeFileSizeMB / (float) uncompressedStoreFileSizeMB)); Strings.appendKeyValue(sb, "memstoreSizeMB", memStoreSizeMB); Strings.appendKeyValue(sb, "readRequestsCount", readRequestsCount); Strings.appendKeyValue(sb, "filteredReadRequestsCount", filteredReadRequestsCount); Strings.appendKeyValue(sb, "writeRequestsCount", writeRequestsCount); Strings.appendKeyValue(sb, "rootIndexSizeKB", rootLevelIndexSizeKB); Strings.appendKeyValue(sb, "totalStaticIndexSizeKB", storefileIndexSizeKB); Strings.appendKeyValue(sb, "totalStaticBloomSizeKB", bloomFilterSizeMB); Strings.appendKeyValue(sb, "totalCompactingKVs", compactingCellCount); Strings.appendKeyValue(sb, "currentCompactedKVs", compactedCellCount); float compactionProgressPct = Float.NaN; if (compactingCellCount > 0) { Strings.appendKeyValue(sb, "compactionProgressPct", compactionProgressPct); Strings.appendKeyValue(sb, "coprocessors", getCoprocessorNames()); return sb.toString();
@Override public String toString() { StringBuilder sb = Strings.appendKeyValue(new StringBuilder(), "storeCount", this.getStoreCount()); Strings.appendKeyValue(sb, "storeFileCount", this.getStoreFileCount()); Strings.appendKeyValue(sb, "uncompressedStoreFileSize", this.getUncompressedStoreFileSize()); Strings.appendKeyValue(sb, "lastMajorCompactionTimestamp", this.getLastMajorCompactionTimestamp()); Strings.appendKeyValue(sb, "storeFileSize", this.getStoreFileSize()); if (this.getUncompressedStoreFileSize().get() != 0) { Strings.appendKeyValue(sb, "compressionRatio", String.format("%.4f", (float) this.getStoreFileSize().get(Size.Unit.MEGABYTE) / (float) this.getUncompressedStoreFileSize().get(Size.Unit.MEGABYTE))); Strings.appendKeyValue(sb, "memStoreSize", this.getMemStoreSize()); Strings.appendKeyValue(sb, "readRequestCount", this.getReadRequestCount()); Strings.appendKeyValue(sb, "writeRequestCount", this.getWriteRequestCount()); Strings.appendKeyValue(sb, "rootLevelIndexSize", this.getStoreFileRootLevelIndexSize()); Strings.appendKeyValue(sb, "uncompressedDataIndexSize", this.getStoreFileUncompressedDataIndexSize()); Strings.appendKeyValue(sb, "bloomFilterSize", this.getBloomFilterSize());
/** * Append to a StringBuilder a key/value. * Uses default separators. * @param sb StringBuilder to use * @param key Key to append. * @param value Value to append. * @return Passed <code>sb</code> populated with key/value. */ public static StringBuilder appendKeyValue(final StringBuilder sb, final String key, final Object value) { return appendKeyValue(sb, key, value, DEFAULT_SEPARATOR, DEFAULT_KEYVALUE_SEPARATOR); }
/** * Append to a StringBuilder a key/value. * Uses default separators. * @param sb StringBuilder to use * @param key Key to append. * @param value Value to append. * @return Passed <code>sb</code> populated with key/value. */ public static StringBuilder appendKeyValue(final StringBuilder sb, final String key, final Object value) { return appendKeyValue(sb, key, value, DEFAULT_SEPARATOR, DEFAULT_KEYVALUE_SEPARATOR); }
/** * Append to a StringBuilder a key/value. * Uses default separators. * @param sb StringBuilder to use * @param key Key to append. * @param value Value to append. * @return Passed <code>sb</code> populated with key/value. */ public static StringBuilder appendKeyValue(final StringBuilder sb, final String key, final Object value) { return appendKeyValue(sb, key, value, DEFAULT_SEPARATOR, DEFAULT_KEYVALUE_SEPARATOR); }
/** * Append to a StringBuilder a key/value. * Uses default separators. * @param sb StringBuilder to use * @param key Key to append. * @param value Value to append. * @return Passed <code>sb</code> populated with key/value. */ public static StringBuilder appendKeyValue(final StringBuilder sb, final String key, final Object value) { return appendKeyValue(sb, key, value, DEFAULT_SEPARATOR, DEFAULT_KEYVALUE_SEPARATOR); }
/** * Returns toString() with the number of requests divided by the message * interval in seconds * @param msgInterval * @return The load as a String */ public String toString(int msgInterval) { int numberOfRegions = this.regionLoad.size(); StringBuilder sb = new StringBuilder(); sb = Strings.appendKeyValue(sb, "requestsPerSecond", Integer.valueOf(numberOfRequests/msgInterval)); sb = Strings.appendKeyValue(sb, "numberOfOnlineRegions", Integer.valueOf(numberOfRegions)); sb = Strings.appendKeyValue(sb, "usedHeapMB", Integer.valueOf(this.usedHeapMB)); sb = Strings.appendKeyValue(sb, "maxHeapMB", Integer.valueOf(maxHeapMB)); return sb.toString(); }
/** * @see Object#toString() */ @Override public String toString() { StringBuilder sb = Strings.appendKeyValue(new StringBuilder(), "requestsPerSecond", Double.valueOf(getRequestsPerSecond())); Strings.appendKeyValue(sb, "numberOfOnlineEntityGroups", Integer .valueOf(getNumberOfEntityGroups())); sb = Strings.appendKeyValue(sb, "readRequestsCount", Long .valueOf(this.readRequestsCount)); sb = Strings.appendKeyValue(sb, "writeRequestsCount", Long .valueOf(this.writeRequestsCount)); sb = Strings.appendKeyValue(sb, "NumberOfConnections", Long.valueOf(getNumberOfConnections())); return sb.toString(); }
/** * sinkToString * @return a string contains sinkReplicationLoad information */ public String sinkToString() { if (this.replicationLoadSink == null) return null; StringBuilder sb = new StringBuilder(); sb = Strings.appendKeyValue(sb, "AgeOfLastAppliedOp", this.replicationLoadSink.getAgeOfLastAppliedOp()); sb = Strings.appendKeyValue(sb, "TimeStampsOfLastAppliedOp", (new Date(this.replicationLoadSink.getTimeStampsOfLastAppliedOp()).toString())); return sb.toString(); }
/** * sourceToString * @return a string contains sourceReplicationLoad information */ public String sourceToString() { if (this.sourceMetricsList == null) return null; StringBuilder sb = new StringBuilder(); for (ClusterStatusProtos.ReplicationLoadSource rls : this.replicationLoadSourceList) { sb = Strings.appendKeyValue(sb, "\n PeerID", rls.getPeerID()); sb = Strings.appendKeyValue(sb, "AgeOfLastShippedOp", rls.getAgeOfLastShippedOp()); sb = Strings.appendKeyValue(sb, "SizeOfLogQueue", rls.getSizeOfLogQueue()); sb = Strings.appendKeyValue(sb, "TimeStampsOfLastShippedOp", (new Date(rls.getTimeStampOfLastShippedOp()).toString())); sb = Strings.appendKeyValue(sb, "Replication Lag", rls.getReplicationLag()); } return sb.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; } }