Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ namespace ServiceControl.Transports.SqlServer;

public class BrokerQueueTableSnapshot(BrokerQueueTable details) : BrokerQueueTable(details.DatabaseDetails, details.Schema, details.Name)
{
public long RowVersion { get; set; }
public long? RowVersion { get; set; }
}
11 changes: 7 additions & 4 deletions src/ServiceControl.Transports.SqlServer/SqlServerQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,14 @@ public override async IAsyncEnumerable<QueueThroughput> GetThroughputPerDay(IBro
var endData =
await queueTableName.DatabaseDetails.GetSnapshot(queueTableName, cancellationToken);

yield return new QueueThroughput
if (endData.RowVersion.HasValue && startData.RowVersion.HasValue)
{
DateUTC = DateOnly.FromDateTime(timeProvider.GetUtcNow().DateTime),
TotalThroughput = endData.RowVersion - startData.RowVersion
};
yield return new QueueThroughput
{
DateUTC = DateOnly.FromDateTime(timeProvider.GetUtcNow().DateTime),
TotalThroughput = endData.RowVersion.Value - startData.RowVersion.Value
};
}

startData = endData;
}
Expand Down
Loading