@Test public void testGetSize() { int amountBuffers = 10; int bufferCapacity = 200; int finalNumberItems = 100; RingBuffer buffer = RingBuffer.create(amountBuffers, bufferCapacity); int expectedSize = 0; for (int i = 1; i < finalNumberItems; i += 10) { byte[] keyAndValue = new byte[i]; buffer.put(keyAndValue, keyAndValue); expectedSize += i; } assertEquals(expectedSize, buffer.getSize()); }
@Override public long getSize() { long size = 0; for (Buffer ringBuffer : ringBuffers) { size += ringBuffer.position; } return size; }
RingBuffer implements RingBufferMBean { @Override public long getSize() { long size = 0; for (Buffer ringBuffer : ringBuffers) { size += ringBuffer.position; } return size; } }
RingBuffer implements RingBufferMBean { @Override public long getSize() { long size = 0; for (Buffer ringBuffer : ringBuffers) { size += ringBuffer.position; } return size; } private  RingBuffer(Buffer[] ringBuffers); }
RingBuffer implements RingBufferMBean { @Override public long getSize() { long size = 0; for (Buffer ringBuffer : ringBuffers) { size += ringBuffer.position; } return size; } private  RingBuffer(Buffer[] ringBuffers); static RingBuffer create(int amountBuffers, int bufferCapacity); Slice get(byte[] key); void put(byte[] key, byte[] data); void put(byte[] key, byte[] data, int offset, int length); @Override void reset(); @Override String getStatsPuts(); @Override double getStatsPutsRate(); @Override long getStatsPutsTotal(); @Override String getStatsGets(); @Override double getStatsGetsRate(); @Override long getStatsGetsTotal(); @Override String getStatsMisses(); @Override double getStatsMissesRate(); @Override long getStatsMissesTotal(); @Override int getItems(); @Override long getSize(); @Override String getLifetime(); @Override long getLifetimeSeconds(); @Override String getCurrentBuffer(); @Override int getFullCycles(); }
RingBuffer implements RingBufferMBean { @Override public long getSize() { long size = 0; for (Buffer ringBuffer : ringBuffers) { size += ringBuffer.position; } return size; } private  RingBuffer(Buffer[] ringBuffers); static RingBuffer create(int amountBuffers, int bufferCapacity); Slice get(byte[] key); void put(byte[] key, byte[] data); void put(byte[] key, byte[] data, int offset, int length); @Override void reset(); @Override String getStatsPuts(); @Override double getStatsPutsRate(); @Override long getStatsPutsTotal(); @Override String getStatsGets(); @Override double getStatsGetsRate(); @Override long getStatsGetsTotal(); @Override String getStatsMisses(); @Override double getStatsMissesRate(); @Override long getStatsMissesTotal(); @Override int getItems(); @Override long getSize(); @Override String getLifetime(); @Override long getLifetimeSeconds(); @Override String getCurrentBuffer(); @Override int getFullCycles();  }