public class StreamCounter extends Object
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 |
|---|
StreamCounter() |
| Modifier and Type | Method and Description |
|---|---|
static UnsafeBufferPosition |
allocate(MutableDirectBuffer tempBuffer,
String name,
int typeId,
CountersManager countersManager,
long registrationId,
int sessionId,
int streamId,
String channel)
Allocate a counter for tracking a position on a stream of messages.
|
static UnsafeBufferPosition |
allocate(MutableDirectBuffer tempBuffer,
String name,
int typeId,
CountersManager countersManager,
long registrationId,
int sessionId,
int streamId,
String channel,
long joinPosition)
Allocate a counter for tracking a position on a stream of messages.
|
static int |
allocateCounterId(MutableDirectBuffer tempBuffer,
String name,
int typeId,
CountersManager countersManager,
long registrationId,
int sessionId,
int streamId,
String channel)
Allocate a counter id for tracking a position on a stream of messages.
|
static 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 UnsafeBufferPosition allocate(MutableDirectBuffer tempBuffer, String name, int typeId, CountersManager countersManager, long registrationId, int sessionId, int streamId, 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(MutableDirectBuffer tempBuffer, String name, int typeId, CountersManager countersManager, long registrationId, int sessionId, int streamId, 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.public static UnsafeBufferPosition allocate(MutableDirectBuffer tempBuffer, String name, int typeId, CountersManager countersManager, long registrationId, int sessionId, int streamId, 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 String labelName(int typeId)
typeId - of the counter.Copyright © 2014-2020 Real Logic Limited. All Rights Reserved.