org.HdrHistogram.Histogram.getNeededByteBufferCapacity()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(126)

本文整理了Java中org.HdrHistogram.Histogram.getNeededByteBufferCapacity()方法的一些代码示例,展示了Histogram.getNeededByteBufferCapacity()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Histogram.getNeededByteBufferCapacity()方法的具体详情如下:
包路径:org.HdrHistogram.Histogram
类名称:Histogram
方法名:getNeededByteBufferCapacity

Histogram.getNeededByteBufferCapacity介绍

暂无

代码示例

代码示例来源:origin: HdrHistogram/HdrHistogram

@Override
public synchronized int getNeededByteBufferCapacity() {
  return super.getNeededByteBufferCapacity();
}

代码示例来源:origin: linkedin/parseq

@Override
public synchronized String serialize(Histogram histogram) {
 int requiredBytes = histogram.getNeededByteBufferCapacity() + (2 * Long.BYTES);  // Long.BYTES for start and end timestamps
 if ((targetBuffer == null) || targetBuffer.capacity() < requiredBytes) {
  targetBuffer = ByteBuffer.allocate(requiredBytes);
 }
 targetBuffer.clear();
 int compressedLength = histogram.encodeIntoCompressedByteBuffer(targetBuffer, Deflater.BEST_COMPRESSION);
 targetBuffer.putLong(compressedLength, histogram.getStartTimeStamp());
 targetBuffer.putLong(compressedLength + Long.BYTES, histogram.getEndTimeStamp());
 byte[] compressedArray = Arrays.copyOf(targetBuffer.array(), compressedLength + (2 * Long.BYTES));
 return DatatypeConverter.printBase64Binary(compressedArray);
}

代码示例来源:origin: glowroot/glowroot

scratchBuffer.execute(histogram.getNeededByteBufferCapacity(), new DoWithByteBuffer() {
  @Override
  public void call(ByteBuffer buffer) {

代码示例来源:origin: org.hdrhistogram/HdrHistogram

@Override
public synchronized int getNeededByteBufferCapacity() {
  return super.getNeededByteBufferCapacity();
}

代码示例来源:origin: org.attribyte/essem-reporter

ByteBuffer buf = ByteBuffer.allocate(storedHistogram.getNeededByteBufferCapacity());
int compressedSize = storedHistogram.encodeIntoCompressedByteBuffer(buf);
buf.rewind();
ByteBuffer buf = ByteBuffer.allocate(storedHistogram.getNeededByteBufferCapacity());
int compressedSize = storedHistogram.encodeIntoCompressedByteBuffer(buf);
buf.rewind();

相关文章