Buffer implements Closeable { public long getAllocatedSize() { return bufferPool.getAllocatedSize(); } Buffer(RecordFormatter recordFormatter);  Buffer(final Config config, RecordFormatter recordFormatter); void flush(Ingester ingester, boolean force); @Override void close(); float getBufferUsage(); void clearBackupFiles(); long getMaxBufferSize(); String getFileBackupPrefix(); String getFileBackupDir(); void append(String tag, long timestamp, Map<String, Object> data); void append(String tag, EventTime timestamp, Map<String, Object> data); void appendMessagePackMapValue(String tag, long timestamp, byte[] mapValue, int offset, int len); void appendMessagePackMapValue(String tag, EventTime timestamp, byte[] mapValue, int offset, int len); void appendMessagePackMapValue(String tag, long timestamp, ByteBuffer mapValue); void appendMessagePackMapValue(String tag, EventTime timestamp, ByteBuffer mapValue); long getAllocatedSize(); long getBufferedDataSize(); boolean getJvmHeapBufferMode(); String bufferFormatType(); int getChunkInitialSize(); float getChunkExpandRatio(); int getChunkRetentionSize(); int getChunkRetentionTimeMillis(); @Override String toString();  }
@Test void testGetAllocatedSize() throws IOException { bufferConfig.setChunkInitialSize(256 * 1024); try (Buffer buffer = new Buffer(bufferConfig, recordFormatter)) { assertThat(buffer.getAllocatedSize(), is(0L)); Map<String, Object> map = new HashMap<>(); map.put("name", "komamitsu"); for (int i = 0; i < 10; i++) { buffer.append("foo.bar", new Date().getTime(), map); } assertThat(buffer.getAllocatedSize(), is(256 * 1024L)); } }