public final class RaftServerMetricsImpl extends RatisMetrics implements RaftServerMetrics
RATIS_APPLICATION_NAME_METRICS, registry| 构造器和说明 |
|---|
RaftServerMetricsImpl(RaftGroupMemberId serverId,
Supplier<Function<RaftPeerId,org.apache.ratis.proto.RaftProtos.CommitInfoProto>> commitInfoCache,
Supplier<RetryCache.Statistics> retryCacheStatistics) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addFollower(RaftPeerId followerName)
Register a follower with this Leader Metrics registry instance.
|
void |
addNumPendingRequestsGauge(com.codahale.metrics.Gauge queueSize) |
void |
addNumPendingRequestsMegaByteSize(com.codahale.metrics.Gauge megabyteSize) |
void |
addPeerCommitIndexGauge(RaftPeerId peerId)
Register a commit index tracker for the peer in cluster.
|
static RaftServerMetricsImpl |
computeIfAbsentRaftServerMetrics(RaftGroupMemberId serverId,
Supplier<Function<RaftPeerId,org.apache.ratis.proto.RaftProtos.CommitInfoProto>> commitInfoCache,
Supplier<RetryCache.Statistics> retryCacheStatistics) |
com.codahale.metrics.Timer |
getClientRequestTimer(RaftClientRequest.Type request) |
com.codahale.metrics.Counter |
getCounter(String counterName) |
com.codahale.metrics.Timer |
getFollowerAppendEntryTimer(boolean isHeartbeat) |
static com.codahale.metrics.Gauge |
getPeerCommitIndexGauge(RaftGroupMemberId serverId,
RaftPeerId peerId)
Get the commit index gauge for the given peer of the server
|
RatisMetricRegistry |
getRegistry() |
com.codahale.metrics.Timer |
getTimer(String timerName) |
void |
incFailedRequestCount(RaftClientRequest.Type type) |
void |
onRequestByteSizeLimitHit() |
void |
onRequestQueueLimitHit() |
void |
onResourceLimitHit() |
void |
onSnapshotInstalled() |
void |
recordFollowerHeartbeatElapsedTime(RaftPeerId followerId,
long elapsedTimeNs)
Record heartbeat elapsed time for a follower within a Raft group.
|
boolean |
removeNumPendingRequestsByteSize() |
boolean |
removeNumPendingRequestsGauge() |
static void |
removeRaftServerMetrics(RaftGroupMemberId serverId) |
create, unregisterpublic static final String FOLLOWER_LAST_HEARTBEAT_ELAPSED_TIME_METRIC
public static final String FOLLOWER_APPEND_ENTRIES_LATENCY
public static final String LEADER_METRIC_PEER_COMMIT_INDEX
public static final String RAFT_CLIENT_STALE_READ_REQUEST
public static final String REQUEST_QUEUE_LIMIT_HIT_COUNTER
public static final String REQUEST_BYTE_SIZE_LIMIT_HIT_COUNTER
public static final String RETRY_CACHE_ENTRY_COUNT_METRIC
public static final String RATIS_SERVER_FAILED_CLIENT_STALE_READ_COUNT
public static final String RATIS_SERVER_FAILED_CLIENT_READ_COUNT
public static final String RATIS_SERVER_FAILED_CLIENT_WRITE_COUNT
public static final String RATIS_SERVER_FAILED_CLIENT_WATCH_COUNT
public static final String RATIS_SERVER_FAILED_CLIENT_STREAM_COUNT
public RaftServerMetricsImpl(RaftGroupMemberId serverId, Supplier<Function<RaftPeerId,org.apache.ratis.proto.RaftProtos.CommitInfoProto>> commitInfoCache, Supplier<RetryCache.Statistics> retryCacheStatistics)
public static RaftServerMetricsImpl computeIfAbsentRaftServerMetrics(RaftGroupMemberId serverId, Supplier<Function<RaftPeerId,org.apache.ratis.proto.RaftProtos.CommitInfoProto>> commitInfoCache, Supplier<RetryCache.Statistics> retryCacheStatistics)
public static void removeRaftServerMetrics(RaftGroupMemberId serverId)
public void addFollower(RaftPeerId followerName)
public void addPeerCommitIndexGauge(RaftPeerId peerId)
public static com.codahale.metrics.Gauge getPeerCommitIndexGauge(RaftGroupMemberId serverId, RaftPeerId peerId)
public void recordFollowerHeartbeatElapsedTime(RaftPeerId followerId, long elapsedTimeNs)
followerId - the follower id.elapsedTimeNs - Elapsed time in Nanos.public com.codahale.metrics.Timer getFollowerAppendEntryTimer(boolean isHeartbeat)
public com.codahale.metrics.Timer getTimer(String timerName)
public com.codahale.metrics.Counter getCounter(String counterName)
public com.codahale.metrics.Timer getClientRequestTimer(RaftClientRequest.Type request)
public void onRequestQueueLimitHit()
public void addNumPendingRequestsGauge(com.codahale.metrics.Gauge queueSize)
public boolean removeNumPendingRequestsGauge()
public void addNumPendingRequestsMegaByteSize(com.codahale.metrics.Gauge megabyteSize)
public boolean removeNumPendingRequestsByteSize()
public void onRequestByteSizeLimitHit()
public void onResourceLimitHit()
public void incFailedRequestCount(RaftClientRequest.Type type)
public void onSnapshotInstalled()
onSnapshotInstalled 在接口中 RaftServerMetricspublic RatisMetricRegistry getRegistry()
getRegistry 在类中 RatisMetricsCopyright © 2017–2022 The Apache Software Foundation. All rights reserved.