diff --git a/src/Raven.Server/Monitoring/Snmp/Objects/Database/5.1/5.1.11/ActiveOngoingTasksBase.cs b/src/Raven.Server/Monitoring/Snmp/Objects/Database/5.1/5.1.11/ActiveOngoingTasksBase.cs index 72fd4c9743ca..5ebb2e755180 100644 --- a/src/Raven.Server/Monitoring/Snmp/Objects/Database/5.1/5.1.11/ActiveOngoingTasksBase.cs +++ b/src/Raven.Server/Monitoring/Snmp/Objects/Database/5.1/5.1.11/ActiveOngoingTasksBase.cs @@ -66,6 +66,8 @@ protected override Integer32 GetData() protected static int GetNumberOfActiveSqlEtls(RachisState rachisState, string nodeTag, RawDatabaseRecord database) => CountTasks(rachisState, nodeTag, database.Topology, database.SqlEtls.Where(x => x.Disabled == false)); + protected static int GetNumberOfActiveQueueSinks(RachisState rachisState, string nodeTag, RawDatabaseRecord database) => CountTasks(rachisState, nodeTag, database.Topology, database.QueueSinks.Where(x => x.Disabled == false)); + protected static int GetNumberOfActiveSubscriptions(TransactionOperationContext context, RachisState rachisState, string nodeTag, RawDatabaseRecord database) { var count = 0; diff --git a/src/Raven.Server/Monitoring/Snmp/Objects/Database/5.1/5.1.11/TotalNumberOfActiveQueueSinkTasks.cs b/src/Raven.Server/Monitoring/Snmp/Objects/Database/5.1/5.1.11/TotalNumberOfActiveQueueSinkTasks.cs new file mode 100644 index 000000000000..17479d67df99 --- /dev/null +++ b/src/Raven.Server/Monitoring/Snmp/Objects/Database/5.1/5.1.11/TotalNumberOfActiveQueueSinkTasks.cs @@ -0,0 +1,17 @@ +using Raven.Client.ServerWide; +using Raven.Server.ServerWide; +using Raven.Server.ServerWide.Context; + +namespace Raven.Server.Monitoring.Snmp.Objects.Database; + +public class TotalNumberOfActiveQueueSinkTasks : ActiveOngoingTasksBase +{ + public TotalNumberOfActiveQueueSinkTasks(ServerStore serverStore) : base(serverStore, SnmpOids.Databases.General.TotalNumberOfActiveQueueSinkTasks) + { + } + + protected override int GetCount(TransactionOperationContext context, RachisState rachisState, string nodeTag, RawDatabaseRecord database) + { + return GetNumberOfActiveQueueSinks(rachisState, nodeTag, database); + } +} diff --git a/src/Raven.Server/Monitoring/Snmp/SnmpOids.cs b/src/Raven.Server/Monitoring/Snmp/SnmpOids.cs index 247d27000988..f6ef1bab4110 100644 --- a/src/Raven.Server/Monitoring/Snmp/SnmpOids.cs +++ b/src/Raven.Server/Monitoring/Snmp/SnmpOids.cs @@ -709,6 +709,9 @@ private General() [Description("Number of active Pull Replication As Sink tasks for all databases")] public const string TotalNumberOfActivePullReplicationAsSinkTasks = "5.1.11.20"; + [Description("Number of active Queue Sink tasks for all databases")] + public const string TotalNumberOfActiveQueueSinkTasks = "5.1.11.21"; + public static DynamicJsonArray ToJson() { var array = new DynamicJsonArray(); diff --git a/test/FastTests/Issues/RavenDB_21412.cs b/test/FastTests/Issues/RavenDB_21412.cs index 9f2ae1749e28..b00ca8b0eea0 100644 --- a/test/FastTests/Issues/RavenDB_21412.cs +++ b/test/FastTests/Issues/RavenDB_21412.cs @@ -34,7 +34,8 @@ public void Validate_All_OngoingTaskTypes_Are_Added_To_Snmp() OngoingTaskType.RavenEtl, OngoingTaskType.Replication, OngoingTaskType.SqlEtl, - OngoingTaskType.Subscription + OngoingTaskType.Subscription, + OngoingTaskType.QueueSink }; foreach (var enumValue in Enum.GetValues())