@Test public void testDecode() throws Exception { when(delegate.decode(DATA)).thenReturn(OBJECT); final Object res = objectObjectSizeMonitoringTranscoder.decode(DATA); assertEquals("decoded object", OBJECT, res); verify(histogram).update(OBJECT_SIZE); verify(counter).inc(OBJECT_SIZE); }
@Override public T decode(final byte[] b) { if (shouldSampleNow()) { final int size = b.length; getHisto.update(size); getBytes.inc(size); } return delegate.decode(b); }
ObjectSizeMonitoringTranscoder implements Transcoder<T> { @Override public T decode(final byte[] b) { if (shouldSampleNow()) { final int size = b.length; getHisto.update(size); getBytes.inc(size); } return delegate.decode(b); } }
ObjectSizeMonitoringTranscoder implements Transcoder<T> { @Override public T decode(final byte[] b) { if (shouldSampleNow()) { final int size = b.length; getHisto.update(size); getBytes.inc(size); } return delegate.decode(b); } ObjectSizeMonitoringTranscoder(final Transcoder<T> transcoderDelegate, final MetricFactory metricFactory, final String cacheName, long sampleRate); }
ObjectSizeMonitoringTranscoder implements Transcoder<T> { @Override public T decode(final byte[] b) { if (shouldSampleNow()) { final int size = b.length; getHisto.update(size); getBytes.inc(size); } return delegate.decode(b); } ObjectSizeMonitoringTranscoder(final Transcoder<T> transcoderDelegate, final MetricFactory metricFactory, final String cacheName, long sampleRate); @Override T decode(final byte[] b); @Override byte[] encode(final T t); }
ObjectSizeMonitoringTranscoder implements Transcoder<T> { @Override public T decode(final byte[] b) { if (shouldSampleNow()) { final int size = b.length; getHisto.update(size); getBytes.inc(size); } return delegate.decode(b); } ObjectSizeMonitoringTranscoder(final Transcoder<T> transcoderDelegate, final MetricFactory metricFactory, final String cacheName, long sampleRate); @Override T decode(final byte[] b); @Override byte[] encode(final T t);  }