public String formattedMetrics(ByteBufAllocatorMetric allocatorMetric) { int capacity = allocatorMetric != null ? 384: 96; // roughly with or without allocator metrics StringBuilder sb = new StringBuilder(capacity) .append('{') .append(" poolName: ").append(getName()) .append(", initialPoolSize: ").append(getInitialSize()) .append(", totalPoolSize: ").append(getTotalSize()) .append(", availablePoolSize: ").append(getAvailableSize()); if (allocatorMetric != null) { sb.append(", allocatorMetric: ").append(allocatorMetric); } return sb.append('}').toString(); }
public String formattedMetrics(ByteBufAllocatorMetric allocatorMetric) { int capacity = allocatorMetric != null ? 384: 96; // roughly with or without allocator metrics StringBuilder sb = new StringBuilder(capacity) .append('{') .append(" poolName: ").append(getName()) .append(", initialPoolSize: ").append(getInitialSize()) .append(", totalPoolSize: ").append(getTotalSize()) .append(", availablePoolSize: ").append(getAvailableSize()); if (allocatorMetric != null) { sb.append(", allocatorMetric: ").append(allocatorMetric); } return sb.append('}').toString(); }
/** * Creates pooled {@link BufferedItemSource} instances * * @param delta number of elements to be pooled */ @Override public final void incrementPoolSize(int delta) { long start = System.currentTimeMillis(); for (int i = 0; i < delta; i++) { incrementPoolSize(); } LOGGER.info("Pool [{}] {} pooled elements added. Total pooled elements: {}. Took: {}ms", getName(), delta, getTotalSize(), (System.currentTimeMillis() - start)); }
/** * Creates pooled {@link BufferedItemSource} instances * * @param delta number of elements to be pooled */ @Override public final void incrementPoolSize(int delta) { long start = System.currentTimeMillis(); for (int i = 0; i < delta; i++) { incrementPoolSize(); } LOGGER.info("Pool [{}] {} pooled elements added. Total pooled elements: {}. Took: {}ms", getName(), delta, getTotalSize(), (System.currentTimeMillis() - start)); }