zarusz / SlimMessageBus

Lightweight message bus interface for .NET (pub/sub and request-response) with transport plugins for popular message brokers.
Apache License 2.0
467 stars 78 forks source link

[Host.Outbox] Ensure SQL tables are provisioned and baseline test #263

Closed zarusz closed 3 months ago

zarusz commented 3 months ago

The test (OutboxBenchmarkTests) would be run locally against the same machine (GitHub Actions agent). It collects the times it took to produce and then consumes N messages. We can use the times to compare if the new enhancements are better. In the future more types of use cases could be added to baseline the Outbox from different angles.

For example, a run from my local machine to the Azure Service Bus + Azure SQL instance, for 1000 messages:

With Outbox:

[12:59:34 INF] SlimMessageBus.Host.Outbox.DbContext.Test.OutboxBenchmarkTests Message Publish took: "00:00:18.2214666"
[12:59:34 INF] SlimMessageBus.Host.Outbox.DbContext.Test.OutboxBenchmarkTests Message Consume took: "00:01:42.5709066"

Without Outbox:

[12:57:33 INF] SlimMessageBus.Host.Outbox.DbContext.Test.OutboxBenchmarkTests Message Publish took: "00:00:02.2195892"
[12:57:33 INF] SlimMessageBus.Host.Outbox.DbContext.Test.OutboxBenchmarkTests Message Consume took: "00:00:06.5525862"
zarusz commented 3 months ago

@EtherZa I have fine-tuned the ASB settings and made the test run with outbox vs without outbox to understand the relative overhead. See the new measurements above.

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
89.3% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud