/*
 * Copyright 2014-2025 Real Logic Limited.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef AERON_C_COUNTERS_H
#define AERON_C_COUNTERS_H

// System counters
#define AERON_SYSTEM_COUNTER_ID_BYTES_SENT (0)
#define AERON_SYSTEM_COUNTER_ID_BYTES_RECEIVED (1)
#define AERON_SYSTEM_COUNTER_ID_RECEIVER_PROXY_FAILS (2)
#define AERON_SYSTEM_COUNTER_ID_SENDER_PROXY_FAILS (3)
#define AERON_SYSTEM_COUNTER_ID_CONDUCTOR_PROXY_FAILS (4)
#define AERON_SYSTEM_COUNTER_ID_NAK_MESSAGES_SENT (5)
#define AERON_SYSTEM_COUNTER_ID_NAK_MESSAGES_RECEIVED (6)
#define AERON_SYSTEM_COUNTER_ID_STATUS_MESSAGES_SENT (7)
#define AERON_SYSTEM_COUNTER_ID_STATUS_MESSAGES_RECEIVED (8)
#define AERON_SYSTEM_COUNTER_ID_HEARTBEATS_SENT (9)
#define AERON_SYSTEM_COUNTER_ID_HEARTBEATS_RECEIVED (10)
#define AERON_SYSTEM_COUNTER_ID_RETRANSMITS_SENT (11)
#define AERON_SYSTEM_COUNTER_ID_FLOW_CONTROL_UNDER_RUNS (12)
#define AERON_SYSTEM_COUNTER_ID_FLOW_CONTROL_OVER_RUNS (13)
#define AERON_SYSTEM_COUNTER_ID_INVALID_PACKETS (14)
#define AERON_SYSTEM_COUNTER_ID_ERRORS (15)
#define AERON_SYSTEM_COUNTER_ID_SHORT_SENDS (16)
#define AERON_SYSTEM_COUNTER_ID_FREE_FAILS (17)
#define AERON_SYSTEM_COUNTER_ID_SENDER_FLOW_CONTROL_LIMITS (18)
#define AERON_SYSTEM_COUNTER_ID_UNBLOCKED_PUBLICATIONS (19)
#define AERON_SYSTEM_COUNTER_ID_UNBLOCKED_COMMANDS (20)
#define AERON_SYSTEM_COUNTER_ID_POSSIBLE_TTL_ASYMMETRY (21)
#define AERON_SYSTEM_COUNTER_ID_CONTROLLABLE_IDLE_STRATEGY (22)
#define AERON_SYSTEM_COUNTER_ID_LOSS_GAP_FILLS (23)
#define AERON_SYSTEM_COUNTER_ID_CLIENT_TIMEOUTS (24)
#define AERON_SYSTEM_COUNTER_ID_RESOLUTION_CHANGES (25)
#define AERON_SYSTEM_COUNTER_ID_CONDUCTOR_MAX_CYCLE_TIME (26)
#define AERON_SYSTEM_COUNTER_ID_CONDUCTOR_CYCLE_TIME_THRESHOLD_EXCEEDED (27)
#define AERON_SYSTEM_COUNTER_ID_SENDER_MAX_CYCLE_TIME (28)
#define AERON_SYSTEM_COUNTER_ID_SENDER_CYCLE_TIME_THRESHOLD_EXCEEDED (29)
#define AERON_SYSTEM_COUNTER_ID_RECEIVER_MAX_CYCLE_TIME (30)
#define AERON_SYSTEM_COUNTER_ID_RECEIVER_CYCLE_TIME_THRESHOLD_EXCEEDED (31)
#define AERON_SYSTEM_COUNTER_ID_NAME_RESOLVER_MAX_TIME (32)
#define AERON_SYSTEM_COUNTER_ID_NAME_RESOLVER_TIME_THRESHOLD_EXCEEDED (33)
#define AERON_SYSTEM_COUNTER_ID_AERON_VERSION (34)
#define AERON_SYSTEM_COUNTER_ID_BYTES_CURRENTLY_MAPPED (35)
#define AERON_SYSTEM_COUNTER_ID_RETRANSMITTED_BYTES (36)
#define AERON_SYSTEM_COUNTER_ID_RETRANSMIT_OVERFLOW (37)
#define AERON_SYSTEM_COUNTER_ID_ERROR_FRAMES_RECEIVED (38)
#define AERON_SYSTEM_COUNTER_ID_ERROR_FRAMES_SENT (39)
#define AERON_SYSTEM_COUNTER_ID_PUBLICATIONS_REVOKED (40)
#define AERON_SYSTEM_COUNTER_ID_PUBLICATION_IMAGES_REVOKED (41)
#define AERON_SYSTEM_COUNTER_ID_IMAGES_REJECTED (42)
#define AERON_SYSTEM_COUNTER_ID_CONTROL_PROTOCOL_VERSION (43)

// Driver counters
#define AERON_COUNTER_SYSTEM_COUNTER_TYPE_ID (0)

#define AERON_COUNTER_PUBLISHER_LIMIT_NAME "pub-lmt"
#define AERON_COUNTER_PUBLISHER_LIMIT_TYPE_ID (1)

#define AERON_COUNTER_SENDER_POSITION_NAME "snd-pos"
#define AERON_COUNTER_SENDER_POSITION_TYPE_ID (2)

#define AERON_COUNTER_RECEIVER_HWM_NAME "rcv-hwm"
#define AERON_COUNTER_RECEIVER_HWM_TYPE_ID (3)

#define AERON_COUNTER_SUBSCRIPTION_POSITION_NAME "sub-pos"
#define AERON_COUNTER_SUBSCRIPTION_POSITION_TYPE_ID (4)

#define AERON_COUNTER_RECEIVER_POSITION_NAME "rcv-pos"
#define AERON_COUNTER_RECEIVER_POSITION_TYPE_ID (5)

#define AERON_COUNTER_SEND_CHANNEL_STATUS_NAME "snd-channel"
#define AERON_COUNTER_SEND_CHANNEL_STATUS_TYPE_ID (6)

#define AERON_COUNTER_RECEIVE_CHANNEL_STATUS_NAME "rcv-channel"
#define AERON_COUNTER_RECEIVE_CHANNEL_STATUS_TYPE_ID (7)

#define AERON_COUNTER_SENDER_LIMIT_NAME "snd-lmt"
#define AERON_COUNTER_SENDER_LIMIT_TYPE_ID (9)

#define AERON_COUNTER_PER_IMAGE_TYPE_ID (10)

#define AERON_COUNTER_CLIENT_HEARTBEAT_TIMESTAMP_NAME "client-heartbeat"
#define AERON_COUNTER_CLIENT_HEARTBEAT_TIMESTAMP_TYPE_ID (11)

#define AERON_COUNTER_PUBLISHER_POSITION_NAME "pub-pos (sampled)"
#define AERON_COUNTER_PUBLISHER_POSITION_TYPE_ID (12)

#define AERON_COUNTER_SENDER_BPE_NAME "snd-bpe"
#define AERON_COUNTER_SENDER_BPE_TYPE_ID  (13)

#define AERON_COUNTER_RCV_LOCAL_SOCKADDR_NAME "rcv-local-sockaddr"
#define AERON_COUNTER_SND_LOCAL_SOCKADDR_NAME "snd-local-sockaddr"
#define AERON_COUNTER_LOCAL_SOCKADDR_TYPE_ID (14)

// Name Resolver 15-16

#define AERON_COUNTER_FC_NUM_RECEIVERS_TYPE_ID (17)

#define AERON_COUNTER_CHANNEL_MDC_NUM_DESTINATIONS_NAME "mdc-num-dest"
#define AERON_COUNTER_CHANNEL_NUM_DESTINATIONS_TYPE_ID (18)

#define AERON_COUNTER_SENDER_NAKS_RECEIVED_NAME "snd-naks-received"
#define AERON_COUNTER_SENDER_NAKS_RECEIVED_TYPE_ID  (19)

#define AERON_COUNTER_RECEIVER_NAKS_SENT_NAME "rcv-naks-sent"
#define AERON_COUNTER_RECEIVER_NAKS_SENT_TYPE_ID  (20)

// AERON_EF_VI reserved range 50-74
// AERON_DPDK reserved range 75-99

// Archive counters

#define AERON_COUNTER_ARCHIVE_RECORDING_POSITION_TYPE_ID (100);

#define AERON_COUNTER_ARCHIVE_ERROR_COUNT_TYPE_ID (101);

#define AERON_COUNTER_ARCHIVE_CONTROL_SESSIONS_TYPE_ID (102);

#define AERON_COUNTER_ARCHIVE_MAX_CYCLE_TIME_TYPE_ID (103);

#define AERON_COUNTER_ARCHIVE_CYCLE_TIME_THRESHOLD_EXCEEDED_TYPE_ID (104);

#define AERON_COUNTER_ARCHIVE_RECORDER_MAX_WRITE_TIME_TYPE_ID (105);

#define AERON_COUNTER_ARCHIVE_RECORDER_TOTAL_WRITE_BYTES_TYPE_ID (106);

#define AERON_COUNTER_ARCHIVE_RECORDER_TOTAL_WRITE_TIME_TYPE_ID (107);

#define AERON_COUNTER_ARCHIVE_REPLAYER_MAX_READ_TIME_TYPE_ID (108);

#define AERON_COUNTER_ARCHIVE_REPLAYER_TOTAL_READ_BYTES_TYPE_ID (109);

#define AERON_COUNTER_ARCHIVE_REPLAYER_TOTAL_READ_TIME_TYPE_ID (110);

#define AERON_COUNTER_ARCHIVE_REPLAY_SESSION_COUNT_TYPE_ID (112);

#define AERON_COUNTER_ARCHIVE_CONTROL_SESSION_TYPE_ID (113);

// Cluster counters

#define AERON_COUNTER_CLUSTER_CONSENSUS_MODULE_STATE_TYPE_ID (200)

#define AERON_COUNTER_CLUSTER_NODE_ROLE_TYPE_ID (201)

#define AERON_COUNTER_CLUSTER_CONTROL_TOGGLE_TYPE_ID (202)

#define AERON_COUNTER_CLUSTER_COMMIT_POSITION_TYPE_ID (203)

#define AERON_COUNTER_CLUSTER_RECOVERY_STATE_TYPE_ID (204)

#define AERON_COUNTER_CLUSTER_SNAPSHOT_COUNTER_TYPE_ID (205)

#define AERON_COUNTER_CLUSTER_ELECTION_STATE_TYPE_ID (207)

#define AERON_COUNTER_CLUSTER_BACKUP_STATE_TYPE_ID (208)

#define AERON_COUNTER_CLUSTER_BACKUP_LIVE_LOG_POSITION_TYPE_ID (209)

#define AERON_COUNTER_CLUSTER_BACKUP_QUERY_DEADLINE_TYPE_ID (210)

#define AERON_COUNTER_CLUSTER_BACKUP_ERROR_COUNT_TYPE_ID (211)

#define AERON_COUNTER_CLUSTER_CONSENSUS_MODULE_ERROR_COUNT_TYPE_ID (212)

#define AERON_COUNTER_CLUSTER_CLIENT_TIMEOUT_COUNT_TYPE_ID (213)

#define AERON_COUNTER_CLUSTER_INVALID_REQUEST_COUNT_TYPE_ID (214)

#define AERON_COUNTER_CLUSTER_CLUSTERED_SERVICE_ERROR_COUNT_TYPE_ID (215)

#define AERON_COUNTER_CLUSTER_MAX_CYCLE_TIME_TYPE_ID (216)

#define AERON_COUNTER_CLUSTER_CYCLE_TIME_THRESHOLD_EXCEEDED_TYPE_ID (217)

#define AERON_COUNTER_CLUSTER_CLUSTERED_SERVICE_MAX_CYCLE_TIME_TYPE_ID (218)

#define AERON_COUNTER_CLUSTER_CLUSTERED_SERVICE_CYCLE_TIME_THRESHOLD_EXCEEDED_TYPE_ID (219)

#define AERON_COUNTER_CLUSTER_STANDBY_STATE_TYPE_ID (220)

#define AERON_COUNTER_CLUSTER_STANDBY_ERROR_COUNT_TYPE_ID (221)

#define AERON_COUNTER_CLUSTER_STANDBY_HEARTBEAT_RESPONSE_COUNT_TYPE_ID (222)

#define AERON_COUNTER_CLUSTER_STANDBY_CONTROL_TOGGLE_TYPE_ID (223)

#define AERON_COUNTER_CLUSTER_TRANSITION_MODULE_STATE_TYPE_ID (224)

#define AERON_COUNTER_CLUSTER_TRANSITION_MODULE_CONTROL_TOGGLE_TYPE_ID (225)

#define AERON_COUNTER_CLUSTER_TRANSITION_MODULE_ERROR_COUNT_TYPE_ID (226)

#define AERON_COUNTER_CLUSTER_STANDBY_MAX_CYCLE_TIME_TYPE_ID (227)

#define AERON_COUNTER_CLUSTER_STANDBY_CYCLE_TIME_THRESHOLD_EXCEEDED_TYPE_ID (228)

#define AERON_COUNTER_CLUSTER_TRANSITION_MODULE_MAX_CYCLE_TIME_TYPE_ID (229)

#define AERON_COUNTER_CLUSTER_TRANSITION_MODULE_CYCLE_TIME_THRESHOLD_EXCEEDED_TYPE_ID (230)

#define AERON_COUNTER_CLUSTER_STANDBY_SOURCE_MEMBER_ID_TYPE_ID (231)

#define AERON_COUNTER_CLUSTER_TOTAL_SNAPSHOT_DURATION_THRESHOLD_EXCEEDED_TYPE_ID (235)

#define AERON_COUNTER_CLUSTERED_SERVICE_SNAPSHOT_DURATION_THRESHOLD_EXCEEDED_TYPE_ID (237)

#define AERON_COUNTER_CLUSTER_ELECTION_COUNT_TYPE_ID (238)

#define AERON_COUNTER_CLUSTER_LEADERSHIP_TERM_ID_TYPE_ID (239)

// Sequencer counters

#define AERON_COUNTER_SEQUENCER_INDEX_COUNTER_TYPE_ID (500)

#define AERON_COUNTER_SEQUENCER_GROUP_HWM_COUNTER_TYPE_ID (501)

#define AERON_COUNTER_SEQUENCER_SESSION_GREATEST_MESSAGE_ID_COUNTER_TYPE_ID (502)

#define AERON_COUNTER_SEQUENCER_SESSION_MESSAGES_COUNTER_TYPE_ID (503)

#define AERON_COUNTER_SEQUENCER_SESSION_GREATEST_MESSAGE_TIMESTAMP_COUNTER_TYPE_ID (504)

#define AERON_COUNTER_SEQUENCER_CLIENT_SNAPSHOT_ID_COUNTER_TYPE_ID (505)

#define AERON_COUNTER_SEQUENCER_APPLICATION_SEQUENCE_INDEX_COUNTER_TYPE_ID (507)

#define AERON_COUNTER_SEQUENCER_APPLICATION_STATE_COUNTER_TYPE_ID (508)

#define AERON_COUNTER_SEQUENCER_APPLICATION_ERROR_COUNT_TYPE_ID (509)

#define AERON_COUNTER_SEQUENCER_APPLICATION_MAX_SERVICE_TIME_TYPE_ID (510)

#define AERON_COUNTER_SEQUENCER_APPLICATION_SERVICE_TIME_THRESHOLD_EXCEEDED_COUNT_TYPE_ID (511)

#define AERON_COUNTER_SEQUENCER_APPLICATION_INTERVAL_SERVICE_TIME_TYPE_ID (512)

#define AERON_COUNTER_SEQUENCER_APPLICATION_INTERVAL_MAX_SERVICE_TIME_TYPE_ID (513)

#define AERON_COUNTER_SEQUENCER_APPLICATION_INTERVAL_TOTAL_INVOCATIONS_TYPE_ID (514)

#define AERON_COUNTER_SEQUENCER_APPLICATION_SNAPSHOT_LOAD_TIME_TYPE_ID (515)

#define AERON_COUNTER_SEQUENCER_APPLICATION_SNAPSHOT_STORE_TIME_TYPE_ID (516)

#define AERON_COUNTER_SEQUENCER_APPLICATION_TAKE_SNAPSHOT_FAILURES_TYPE_ID (517)

#define AERON_COUNTER_SEQUENCER_APPLICATION_TAKE_SNAPSHOT_COUNT_TYPE_ID (518)

#define AERON_COUNTER_SEQUENCER_APPLICATION_SESSION_ID_TYPE_ID (519)

#define AERON_COUNTER_SEQUENCER_REPLAY_INDEX_MIN_SEQUENCE_INDEX_COUNTER_TYPE_ID (520)

#define AERON_COUNTER_SEQUENCER_REPLAY_INDEX_MIN_SEQUENCE_LOG_POSITION_COUNTER_TYPE_ID (521)

#define AERON_COUNTER_SEQUENCER_REPLAY_INDEX_MAX_SEQUENCE_INDEX_COUNTER_TYPE_ID (522)

#define AERON_COUNTER_SEQUENCER_REPLAY_INDEX_MAX_SEQUENCE_LOG_POSITION_COUNTER_TYPE_ID (523)

#define AERON_COUNTER_SEQUENCER_REPLAY_INDEX_INITIAL_SEQUENCE_INDEX_COUNTER_TYPE_ID (524)

#define AERON_COUNTER_SEQUENCER_REPLAY_INDEX_INITIAL_SEQUENCE_LOG_POSITION_COUNTER_TYPE_ID (525)

#endif //AERON_C_COUNTERS_H
