aeron-driver/src/main/java/io/aeron/driver/status/StreamCounter.java
public static UnsafeBufferPosition allocate(
        final MutableDirectBuffer tempBuffer,
        final String name,
        final int typeId,
        final CountersManager countersManager,
        final long registrationId,
        final int sessionId,
        final int streamId,
        final String channel)
    {
        return new UnsafeBufferPosition(
            (UnsafeBuffer)countersManager.valuesBuffer(),
            allocateCounterId(tempBuffer, name, typeId, countersManager, registrationId, sessionId, streamId, channel),
            countersManager);
    }
public static UnsafeBufferPosition allocate(
        final MutableDirectBuffer tempBuffer,
        final String name,
        final int typeId,
        final CountersManager countersManager,
        final long registrationId,
        final int sessionId,
        final int streamId,
        final String channel)
    {
        return new UnsafeBufferPosition(
            (UnsafeBuffer)countersManager.valuesBuffer(),
            allocateCounterId(tempBuffer, name, typeId, countersManager, registrationId, sessionId, streamId, channel),
            countersManager);
    }
Allocate a counter for tracking a position on a stream of messages.

@param tempBuffer      to be used for labels and key.
@param name            of the counter for the label.
@param typeId          of the counter for classification.
@param countersManager from which to allocated the underlying storage.
@param registrationId  to be associated with the counter.
@param sessionId       for the stream of messages.
@param streamId        for the stream of messages.
@param channel         for the stream of messages.
@return a new {@link UnsafeBufferPosition} for tracking the stream.