File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed
ServiceControl.Transports.RabbitMQ
ServiceControl.Transports/BrokerThroughput Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 22namespace ServiceControl . Transports . RabbitMQ ;
33
44using System . Collections . Generic ;
5- using ServiceControl . Transports . BrokerThroughput ;
65using NServiceBus . Transport . RabbitMQ . ManagementApi ;
6+ using ServiceControl . Transports . BrokerThroughput ;
77
88class RabbitMQBrokerQueueDetails ( Queue queue ) : IBrokerQueue
99{
1010 public string QueueName { get ; } = queue . Name ;
11+
1112 public string SanitizedName => QueueName ;
13+
1214 public string ? Scope => null ;
13- //public string VHost { get; } = queue.Vhost;
15+
1416 public List < string > EndpointIndicators { get ; } = [ ] ;
17+
1518 long ? AckedMessages { get ; set ; } = queue . MessageStats ? . Ack ;
19+
1620 long Baseline { get ; set ; } = queue . MessageStats ? . Ack ?? 0 ;
1721
1822 public long CalculateThroughputFrom ( RabbitMQBrokerQueueDetails newReading )
1923 {
2024 var newlyAckedMessages = 0L ;
25+
2126 if ( newReading . AckedMessages is null )
2227 {
2328 return newlyAckedMessages ;
@@ -28,6 +33,7 @@ public long CalculateThroughputFrom(RabbitMQBrokerQueueDetails newReading)
2833 newlyAckedMessages = newReading . AckedMessages . Value - Baseline ;
2934 AckedMessages += newlyAckedMessages ;
3035 }
36+
3137 Baseline = newReading . AckedMessages . Value ;
3238
3339 return newlyAckedMessages ;
Original file line number Diff line number Diff line change @@ -7,8 +7,11 @@ namespace ServiceControl.Transports.BrokerThroughput;
77public interface IBrokerQueue
88#pragma warning restore CA1711
99{
10- public string QueueName { get ; }
11- public string SanitizedName { get ; }
12- public string ? Scope { get ; }
13- public List < string > EndpointIndicators { get ; }
10+ string QueueName { get ; }
11+
12+ string SanitizedName { get ; }
13+
14+ string ? Scope { get ; }
15+
16+ List < string > EndpointIndicators { get ; }
1417}
You can’t perform that action at this time.
0 commit comments