public class StreamPositionCounter
extends java.lang.Object
UnsafeBufferPosition
counters on a stream of messages.
Positions tracked in bytes include:
PublisherPos
: Highest position on a Publication
reached for offers and claims as an approximation sampled once per second.PublisherLimit
: Limit for flow controlling a Publication
offers and claims.SenderPos
: Highest position on a Publication
stream sent to the media.SenderLimit
: Limit for flow controlling a Sender
of a stream.ReceiverHwm
: Highest position observed by the Receiver when rebuilding an Image
of a stream.ReceiverPos
: Highest contiguous position rebuilt by the Receiver on an Image
of a stream.SubscriberPos
: Consumption position on an Image
of a stream by individual Subscriber.
Note: All counters are real-time with the exception of PublisherPos
which is sampled once per second
which means it can appear to be behind.
Modifier and Type | Field and Description |
---|---|
static int |
CHANNEL_OFFSET
Offset in the key meta data for the channel of the counter.
|
static int |
MAX_CHANNEL_LENGTH
The maximum length in bytes of the encoded channel identity.
|
static int |
REGISTRATION_ID_OFFSET
Offset in the key meta data for the registration id of the counter.
|
static int |
SESSION_ID_OFFSET
Offset in the key meta data for the session id of the counter.
|
static int |
STREAM_ID_OFFSET
Offset in the key meta data for the stream id of the counter.
|
Constructor and Description |
---|
StreamPositionCounter() |
Modifier and Type | Method and Description |
---|---|
static org.agrona.concurrent.status.UnsafeBufferPosition |
allocate(org.agrona.MutableDirectBuffer tempBuffer,
java.lang.String name,
int typeId,
org.agrona.concurrent.status.CountersManager countersManager,
long registrationId,
int sessionId,
int streamId,
java.lang.String channel)
Allocate a counter for tracking a position on a stream of messages.
|
static org.agrona.concurrent.status.UnsafeBufferPosition |
allocate(org.agrona.MutableDirectBuffer tempBuffer,
java.lang.String name,
int typeId,
org.agrona.concurrent.status.CountersManager countersManager,
long registrationId,
int sessionId,
int streamId,
java.lang.String channel,
long joinPosition)
Allocate a counter for tracking a position on a stream of messages.
|
static int |
allocateCounterId(org.agrona.MutableDirectBuffer tempBuffer,
java.lang.String name,
int typeId,
org.agrona.concurrent.status.CountersManager countersManager,
long registrationId,
int sessionId,
int streamId,
java.lang.String channel) |
static java.lang.String |
labelName(int typeId)
Return the label name for a counter type identifier.
|
public static final int REGISTRATION_ID_OFFSET
public static final int SESSION_ID_OFFSET
public static final int STREAM_ID_OFFSET
public static final int CHANNEL_OFFSET
public static final int MAX_CHANNEL_LENGTH
public static org.agrona.concurrent.status.UnsafeBufferPosition allocate(org.agrona.MutableDirectBuffer tempBuffer, java.lang.String name, int typeId, org.agrona.concurrent.status.CountersManager countersManager, long registrationId, int sessionId, int streamId, java.lang.String channel)
tempBuffer
- to be used for labels and key.name
- of the counter for the label.typeId
- of the counter for classification.countersManager
- from which to allocated the underlying storage.registrationId
- to be associated with the counter.sessionId
- for the stream of messages.streamId
- for the stream of messages.channel
- for the stream of messages.UnsafeBufferPosition
for tracking the stream.public static int allocateCounterId(org.agrona.MutableDirectBuffer tempBuffer, java.lang.String name, int typeId, org.agrona.concurrent.status.CountersManager countersManager, long registrationId, int sessionId, int streamId, java.lang.String channel)
public static org.agrona.concurrent.status.UnsafeBufferPosition allocate(org.agrona.MutableDirectBuffer tempBuffer, java.lang.String name, int typeId, org.agrona.concurrent.status.CountersManager countersManager, long registrationId, int sessionId, int streamId, java.lang.String channel, long joinPosition)
tempBuffer
- to be used for labels and key.name
- of the counter for the label.typeId
- of the counter for classification.countersManager
- from which to allocated the underlying storage.registrationId
- to be associated with the counter.sessionId
- for the stream of messages.streamId
- for the stream of messages.channel
- for the stream of messages.joinPosition
- for the label.UnsafeBufferPosition
for tracking the stream.public static java.lang.String labelName(int typeId)
typeId
- of the counter.Copyright © 2014-2018 Real Logic Ltd. All Rights Reserved.