@Test public void shouldTruncateLongLabel() { final int labelLength = MAX_LABEL_LENGTH + 10; final StringBuilder sb = new StringBuilder(labelLength); for (int i = 0; i < labelLength; i++) { sb.append('x'); } final String label = sb.toString(); final int counterId = manager.allocate(label); reader.forEach(consumer); verify(consumer).accept(counterId, label.substring(0, MAX_LABEL_LENGTH)); }
public int allocate(final String label) { return allocate(label, DEFAULT_TYPE_ID); }
CountersManager extends CountersReader { public int allocate(final String label) { return allocate(label, DEFAULT_TYPE_ID); } }
CountersManager extends CountersReader { public int allocate(final String label) { return allocate(label, DEFAULT_TYPE_ID); } CountersManager(
        final AtomicBuffer metaDataBuffer,
        final AtomicBuffer valuesBuffer,
        final Charset labelCharset,
        final EpochClock epochClock,
        final long freeToReuseTimeoutMs);  CountersManager(
        final AtomicBuffer metaDataBuffer, final AtomicBuffer valuesBuffer, final Charset labelCharset);  CountersManager(final AtomicBuffer metaDataBuffer, final AtomicBuffer valuesBuffer); }
CountersManager extends CountersReader { public int allocate(final String label) { return allocate(label, DEFAULT_TYPE_ID); } CountersManager(
        final AtomicBuffer metaDataBuffer,
        final AtomicBuffer valuesBuffer,
        final Charset labelCharset,
        final EpochClock epochClock,
        final long freeToReuseTimeoutMs);  CountersManager(
        final AtomicBuffer metaDataBuffer, final AtomicBuffer valuesBuffer, final Charset labelCharset);  CountersManager(final AtomicBuffer metaDataBuffer, final AtomicBuffer valuesBuffer); int allocate(final String label); int allocate(final String label, final int typeId); int allocate(final String label, final int typeId, final Consumer<MutableDirectBuffer> keyFunc); int allocate(
        final int typeId,
        final DirectBuffer keyBuffer,
        final int keyOffset,
        final int keyLength,
        final DirectBuffer labelBuffer,
        final int labelOffset,
        final int labelLength); AtomicCounter newCounter(final String label); AtomicCounter newCounter(final String label, final int typeId); AtomicCounter newCounter(final String label, final int typeId, final Consumer<MutableDirectBuffer> keyFunc); AtomicCounter newCounter(
        final int typeId,
        final DirectBuffer keyBuffer,
        final int keyOffset,
        final int keyLength,
        final DirectBuffer labelBuffer,
        final int labelOffset,
        final int labelLength); void free(final int counterId); void setCounterValue(final int counterId, final long value); void setCounterRegistrationId(final int counterId, final long registrationId); void setCounterOwnerId(final int counterId, final long ownerId); void setCounterLabel(final int counterId, final String label); void setCounterKey(final int counterId, final Consumer<MutableDirectBuffer> keyFunc); void setCounterKey(final int counterId, final DirectBuffer keyBuffer, final int offset, final int length); void appendToLabel(final int counterId, final String label); }
CountersManager extends CountersReader { public int allocate(final String label) { return allocate(label, DEFAULT_TYPE_ID); } CountersManager(
        final AtomicBuffer metaDataBuffer,
        final AtomicBuffer valuesBuffer,
        final Charset labelCharset,
        final EpochClock epochClock,
        final long freeToReuseTimeoutMs);  CountersManager(
        final AtomicBuffer metaDataBuffer, final AtomicBuffer valuesBuffer, final Charset labelCharset);  CountersManager(final AtomicBuffer metaDataBuffer, final AtomicBuffer valuesBuffer); int allocate(final String label); int allocate(final String label, final int typeId); int allocate(final String label, final int typeId, final Consumer<MutableDirectBuffer> keyFunc); int allocate(
        final int typeId,
        final DirectBuffer keyBuffer,
        final int keyOffset,
        final int keyLength,
        final DirectBuffer labelBuffer,
        final int labelOffset,
        final int labelLength); AtomicCounter newCounter(final String label); AtomicCounter newCounter(final String label, final int typeId); AtomicCounter newCounter(final String label, final int typeId, final Consumer<MutableDirectBuffer> keyFunc); AtomicCounter newCounter(
        final int typeId,
        final DirectBuffer keyBuffer,
        final int keyOffset,
        final int keyLength,
        final DirectBuffer labelBuffer,
        final int labelOffset,
        final int labelLength); void free(final int counterId); void setCounterValue(final int counterId, final long value); void setCounterRegistrationId(final int counterId, final long registrationId); void setCounterOwnerId(final int counterId, final long ownerId); void setCounterLabel(final int counterId, final String label); void setCounterKey(final int counterId, final Consumer<MutableDirectBuffer> keyFunc); void setCounterKey(final int counterId, final DirectBuffer keyBuffer, final int offset, final int length); void appendToLabel(final int counterId, final String label);  }