8000 Error Counter Type IDs by JPWatson · Pull Request #741 · aeron-io/aeron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Error Counter Type IDs #741

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions aeron-archive/src/main/java/io/aeron/archive/Archive.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import io.aeron.Aeron;
import io.aeron.CommonContext;
import io.aeron.Counter;
import io.aeron.Image;
import io.aeron.archive.client.AeronArchive;
import io.aeron.archive.client.ArchiveException;
Expand All @@ -40,7 +41,6 @@
import java.util.function.Supplier;

import static io.aeron.archive.ArchiveThreadingMode.DEDICATED;
import static io.aeron.driver.status.SystemCounterDescriptor.SYSTEM_COUNTER_TYPE_ID;
import static io.aeron.logbuffer.LogBufferDescriptor.TERM_MAX_LENGTH;
import static io.aeron.logbuffer.LogBufferDescriptor.TERM_MIN_LENGTH;
import static java.lang.System.getProperty;
Expand Down Expand Up @@ -341,6 +341,12 @@ public static class Configuration
*/
static final int MAX_BLOCK_LENGTH = 2 * 1024 * 1024;


/**
* The type id of the {@link Counter} used for keeping track of the number of errors that have occurred.
*/
public static final int ARCHIVE_ERROR_COUNT_TYPE_ID = 101;

/**
* Get the directory name to be used for storing the archive.
*
Expand Down Expand Up @@ -645,7 +651,7 @@ public void conclude()

if (null == errorCounter)
{
errorCounter = aeron.addCounter(SYSTEM_COUNTER_TYPE_ID, "Archive errors");
errorCounter = aeron.addCounter(Configuration.ARCHIVE_ERROR_COUNT_TYPE_ID, "Archive errors");
}
}

Expand Down
14 changes: 9 additions & 5 deletions aeron-cluster/src/main/java/io/aeron/cluster/ClusterBackup.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@

import static io.aeron.CommonContext.ENDPOINT_PARAM_NAME;
import static io.aeron.cluster.ConsensusModule.Configuration.SERVICE_ID;
import static io.aeron.driver.status.SystemCounterDescriptor.SYSTEM_COUNTER_TYPE_ID;
import static java.util.concurrent.atomic.AtomicIntegerFieldUpdater.newUpdater;
import static org.agrona.SystemUtil.getDurationInNanos;

Expand All @@ -55,17 +54,22 @@ public final class ClusterBackup implements AutoCloseable
/**
* The type id of the {@link Counter} used for the backup state.
*/
static final int BACKUP_STATE_TYPE_ID = 208;
public static final int BACKUP_STATE_TYPE_ID = 208;

/**
* The type id of the {@link Counter} used for the live log position counter.
*/
static final int LIVE_LOG_POSITION_TYPE_ID = 209;
public static final int LIVE_LOG_POSITION_TYPE_ID = 209;

/**
* The type id of the {@link Counter} used for the next query deadline counter.
*/
static final int QUERY_DEADLINE_TYPE_ID = 210;
public static final int QUERY_DEADLINE_TYPE_ID = 210;

/**
* The type id of the {@link Counter} used for keeping track of the number of errors that have occurred.
*/
public static final int CLUSTER_BACKUP_ERROR_COUNT_TYPE_ID = 211;

enum State
{
Expand Down Expand Up @@ -430,7 +434,7 @@ public void conclude()

if (null == errorCounter)
{
errorCounter = aeron.addCounter(SYSTEM_COUNTER_TYPE_ID, "ClusterBackup errors");
errorCounter = aeron.addCounter(CLUSTER_BACKUP_ERROR_COUNT_TYPE_ID, "ClusterBackup errors");
}
}

Expand Down
24 changes: 20 additions & 4 deletions aeron-cluster/src/main/java/io/aeron/cluster/ConsensusModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import static io.aeron.cluster.ConsensusModule.Configuration.*;
import static io.aeron.cluster.service.ClusteredServiceContainer.Configuration.SNAPSHOT_CHANNEL_PROP_NAME;
import static io.aeron.cluster.service.ClusteredServiceContainer.Configuration.SNAPSHOT_STREAM_ID_PROP_NAME;
import static io.aeron.driver.status.SystemCounterDescriptor.SYSTEM_COUNTER_TYPE_ID;
import static java.util.concurrent.atomic.AtomicIntegerFieldUpdater.newUpdater;
import static org.agrona.SystemUtil.*;
import static org.agrona.concurrent.status.CountersReader.METADATA_LENGTH;
Expand Down Expand Up @@ -429,6 +428,21 @@ public static class Configuration
*/
public static final int CONSENSUS_MODULE_STATE_TYPE_ID = 200;

/**
* Counter type id for the consensus module error count.
*/
public static final int CONSENSUS_MODULE_ERROR_COUNT_TYPE_ID = 212;

/**
* Counter type id for the number of cluster clients which have been timed out.
*/
public static final int CLUSTER_CLIENT_TIMEOUT_COUNT_TYPE_ID = 213;

/**
* Counter type id for the number of invalid requests which the cluster has received.
*/
public static final int CLUSTER_INVALID_REQUEST_COUNT_TYPE_ID = 214;

/**
* Counter type id for the cluster node role.
*/
Expand Down Expand Up @@ -1147,7 +1161,7 @@ public void conclude()

if (null == errorCounter)
{
errorCounter = aeron.addCounter(SYSTEM_COUNTER_TYPE_ID, "Cluster errors");
errorCounter = aeron.addCounter(CONSENSUS_MODULE_ERROR_COUNT_TYPE_ID, "Cluster errors");
}
}

Expand Down Expand Up @@ -1192,12 +1206,14 @@ public void conclude()

if (null == invalidRequestCounter)
{
invalidRequestCounter = aeron.addCounter(SYSTEM_COUNTER_TYPE_ID, "Invalid cluster request count");
invalidRequestCounter =
aeron.addCounter(CLUSTER_INVALID_REQUEST_COUNT_TYPE_ID, "Invalid cluster request count");
}

if (null == timedOutClientCounter)
{
timedOutClientCounter = aeron.addCounter(SYSTEM_COUNTER_TYPE_ID, "Timed out cluster client count");
timedOutClientCounter =
aeron.addCounter(CLUSTER_CLIENT_TIMEOUT_COUNT_TYPE_ID, "Timed out cluster client count");
}

if (null == clusterNodeRole)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.function.Supplier;

import static io.aeron.driver.status.SystemCounterDescriptor.SYSTEM_COUNTER_TYPE_ID;
import static io.aeron.cluster.service.ClusteredServiceContainer.Configuration.*;
import static java.util.concurrent.atomic.AtomicIntegerFieldUpdater.newUpdater;
import static org.agrona.SystemUtil.getSizeAsInt;
import static org.agrona.SystemUtil.loadPropertiesFiles;
Expand Down Expand Up @@ -283,6 +283,11 @@ public static class Configuration
public static final String DELEGATING_ERROR_HANDLER_PROP_NAME =
"aeron.cluster.service.delegating.error.handler";

/**
* Counter type id for the clustered service error count.
*/
public static final int CLUSTERED_SERVICE_ERROR_COUNT_TYPE_ID = 215;

/**
* The value {@link #SERVICE_ID_DEFAULT} or system property {@link #SERVICE_ID_PROP_NAME} if set.
*
Expand Down Expand Up @@ -642,7 +647,8 @@ public void conclude()

if (null == errorCounter)
{
errorCounter = aeron.addCounter(SYSTEM_COUNTER_TYPE_ID, "Cluster errors - service " + serviceId);
errorCounter =
aeron.addCounter(CLUSTERED_SERVICE_ERROR_COUNT_TYPE_ID, "Cluster errors - service " + serviceId);
}

if (null == countedErrorHandler)
Expand Down
0